Search date variable inside ranges

I have an excel file (or dt) with 3 columns (minimum, maximum, result) and I need to check if a date variable is inside any of that ranges of dates in order to assign the value of the result column of that specific row. Can someone tell me how to do it?

@rodrigoribeirowork96 The Minimum and Maximum Column are Date Values ?

yes.

@rodrigoribeirowork96 Can you Follow these Steps :

  1. Read the Excel File using Read Range Activity, Get the Datatable as Output, say DT

  2. Use For Each Row of the DT
    Inside the For Each Row use an If Activity
    With Condition as (CDate(row(“Minimum”).toString) <= yourDate) and (CDate(row(“Maximum”).ToString)>=yourDate)
    Inside then block use, row(“Result”) = yourValue

  3. Write the Datatable DT to an Excel File.

Check if the Update has taken place. Keep a Backup of the File Before performing these operations.

1 Like

It worked. Thank you!!

1 Like

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