Comparing Two Times In Excel

Hi,

I want to compare 2Columns in excel and i want to know which is greater and which is lower.

For reference i have attached the screenshot below.

image

Thanks
Rishi

1 Like

Hey @Rishik_Chowdary

Here you go…

  1. Read the Excel Table into a DataTable

  2. Iterate Row & Timespan parse the Excel cell value

TimeSpan.Compare(TimeSpan.Parse(row("Time1").ToString), TimeSpan.Parse(row("Time2").ToString))
  1. Use the output result of the above for concluding

|

Hope this helps.

Thanks
#nK

Hey @Nithinkrishna

Thanks for your reply…!! but i was getting error while executing can you please share me the xaml if possible. it would be helpful to me.

Thanks
Rishi

1 Like

Please refer below…

nmnithinkrishna_TimespanComparison.zip (2.0 KB)

Thanks
#nK