How to find Nearest less than Date

I have to find the nearest Date from a datatable 1

i have to find the nearest less than date i.e image1 date

Hi @Manish_Talele

Few steps that you can follow

  1. Use a read range to read the excel onto a datatable
  2. Use sort data table and sort the data in ascending order using the date column
  3. Have the date you want to check in a separate variable
  4. Loop through the datatable using a for each row
  5. Within the loop, use a If condition to check whether the date in the data table row is less than the date you check
  6. If true, assign the date to another variable
  7. On the else condition of the if activity, add a break activity so that as soon as the condition doesnt match, we exit the loop.

By the time you exit, you have the nearest closest day

Hope it helps

1 Like

Thanks that worked!

1 Like

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