Deleting a row from excel on a date based condittion

Hi guys,

Let me explain it real quick.

I have an excel document. There is a column named " Created Date ". its formatted to hh:mm:ss , so its like " 28.02.2020 15:17:32 ".

I want to delete the rows where the date difference between todays date is lower than 15 days old.

so today is 10.03.2020 i dont want to see 01.03.2020 because the difference is lower than 15.

I want to make it in filter datatable activity. I did converted the file in to a DT.

How can I do it.
Thanks .

1 Like

@berkaykor in value give:

or“dd.MM.yyyy hh:mm:ss”)


Hey shanmukh_pothamsetty

I tried both it compiles there is no error but it doesnt filter.

Hi @berkaykor

Can you share a sample excel file


@berkaykor , it might be because when you read from Excel , the MM and date values interchanges
ex: 28-01-2020 12:00:00 in Datatable it will be 01/28/2020 12:00:00

Print the row Created date first and see in which format it is coming
Else share the excel file


Since i just opened the account I cannot share it, site doesnt allow me to.

Is there any other way for me to share?

and i did print it in a message box

@berkaykor in value give this:-“yyyy-MM-dd hh:mm:ss”)

It will solve the issue


Tried it too also didnt work but

you can download the file from here.

thanks alot guys for your efforts

@berkaykor Can you Check this workflow : (11.4 KB)

Check the Page 2 Sheet First, Delete that Sheet, Run the Workflow. Check the Excel File Page 2 Sheet Again. It Should be the Output you needed.

When Comparing Date Values , You cannot convert it into a String and Compare, As it is a String Comparison and not a Date Comparison. That is why you don’t get any results, or you get irrelevant results.

Hence I used a Linq Query to Find the rows which have Dates which are greater than 15 days.

Hope this is what you needed. :sweat_smile:

1 Like

Yess its working thanks alot. I understood the problem as well.

Thank you all.


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