Getting the Month Duration

Hello all,

I have this excel file where there’s a list of month duration. I want to get the duration as integer like for example January 2021-March 2022 then my output must be “14” also I want them to be Separated like January 2021-March 2022 will be splitted to January 2021 and March 2022. I attach below the sample output.
Input:
image
Preferred Output
image

Hi @Gus_Fring

Can you try with this expression

dt.AsEnumerable.Select(Function(r) String.Join(",",Enumerable.Range(0,1+CInt(DateDiff(DateInterval.Month, DateTime.Parse(r("Start Date").ToString+" 1,
New System.Globalization.CultureInfo,
DateTime.Parse(r("End Date").ToString+ 1)))).Select(Function(i) DateTime.Parse(r("Start Date").ToString+" 1,
New System.Globalization.CultureInfo).AddMonths(i).ToString("MMMM-yyyy",New System.Globalization.CultureInfo)))).ToArray

Regards
Gokul

Hi @Gus_Fring ,

What about below

Input

Output

Workflow

Test.xaml (12.0 KB)

Thanks,
Rajkumar