Excel Date column/General column conversion to dd-mm-yyyy format

Hi @Ashrita

when using the above Cell Format activity, in one scenario im getting error .ie: If the Cell is already in Date Format(21/07/2020) and now again if im trying to change the cell format to “dd.mm.yyyy” then it is being converted to “21.00.2020”

You have used the small “mm” for Month so it is giving you error and wrong output.

Use the Capital MM for the Month in the format
Like

"dd.MM.yyyy"

Then it will give you perfect output

mm is used for minutes thats why it is giving you 00 in the month place

Another one more thing you can also implement the If Condition as below if the Input Date Format within Excel is of different Format and you always want the output in “dd-MM-yyyy” format :-

For Format “MM/dd/yyyy” :-

DateTime.ParseExact(CDate(row("Input Dates")).ToString("MM/dd/yyyy"), "MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString(“dd-MM-yyyy”)

For Format “dd.MM.yyyy” :-

DateTime.ParseExact(CDate(row("Input Dates")).ToString("dd.MM.yyyy"), "dd.MM.yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString(“dd-MM-yyyy”)

image

Workflow and Excel for the Same :-
MainPratik.xaml (13.7 KB)
New Microsoft Excel Worksheet.xlsx (9.1 KB)

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

3 Likes