How to get PP value from below excel

WhatsApp Image 2023-09-28 at 00.33.03

Scenario 1. date received is 12/26/22 to 01/08/23 then
the output will be 23/01 as it is falling under row number 2 and ending on 01/08/23

Scenario 2 date received is 12/30/22 to 01/08/23 then
output will be 23/01 as 12/30/22 is after 12/26/22 which is in 2nd row and ending on 01/08/23

Scenario 2 date received is 12/30/22 to 01/25/23 then
output will be 23/01,23/02 and 23/03 as 12/30/22 is after 12/26/22 which is in 2nd row and 01/25/23 is falling under 4th row

Calender.xlsx (10.4 KB)

Any Excel expert, please?

@c3f1e68294fdcf4a1f0a817ca

Try this

dt.AsEnumerable.Where(function(x) DateTime.ParseExact(x(1).ToString,"MMddyyyy",System.Globalization.CultureInfo.InvariantCulture) < DateTime.ParseExact("RequiredDate,"MMddyyyy",System.Globalization.CultureInfo.InvariantCulture)).Select(function(x) x(0).ToString).ToArray()

basically last scenario you provided is little confusing as if the given data is 12/30/22 why would it have 3 dates?

as per the given dates looks like all the periods below the given date are considered…

If you have teo dates then try this

dt.AsEnumerable.Where(function(x) DateTime.ParseExact(x(2).ToString,"MMddyyyy",System.Globalization.CultureInfo.InvariantCulture) > DateTime.ParseExact("FirstDate,"MMddyyyy",System.Globalization.CultureInfo.InvariantCulture) And DateTime.ParseExact(x(1).ToString,"MMddyyyy",System.Globalization.CultureInfo.InvariantCulture) < DateTime.ParseExact("SecondDate","MMddyyyy",System.Globalization.CultureInfo.InvariantCulture)).Select(function(x) x(0).ToString).ToArray()

cheers

Here you go -

Result:
image

Xaml:
CalendarExcel.xaml (14.3 KB)

*Note - Update input file path as per your environment and also take care of exceptions. Considered only happy path. *

Workflow Screenshot:

Regards,
Kartheek Byggari

@KarthikByggari Thanks for your solution however I am unable to understand it how you have designed it. So can you please explain or help me get the date against PP value?
Like in your given example I need to fetch
for 23/01 need 12/26/22 and 01/08/23
for 23/02 need 01/09/23 and 01/22/23
for 23/03 need 01/23/23 and 02/05/23
i.e. from and To value

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.