cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ggim
Frequent Visitor

Adding dates to Excel with same format

Hello,

 

I am building a flow in which I add lines to an Excel file. I have a Date column in which I have to add dates that I read as strings with the following structure: dd.mm.yyyy (Example: 23.08.2022).

To add it to the Excel file, I pass it through the formatDateTime function to get the structure dd/MM/yyyy.

 

However, if I read that same Excel file in some flow, I get two different representations in the Date column: the internal Excel format for dates (Ex: 447744) in the rows that I modify outside Power Automate, and the dates I have added (Ex: 01/08/2022).

I need to read them in the same format so I can deal with them later. How do I get them stored in the same format?

 

Thank you in advance for any assistance you can provide.

1 ACCEPTED SOLUTION

Accepted Solutions
MarconettiMarco
Super User
Super User

Hello @Ggim ,

in regards of the dates that are represented by an integer, you should use the following expression:

addDays('1899-12-30','<your_value>','dd/MM/yyyy')

It means that you have to add 447744 days to the base date.

 

Please let me know if the issue is fixed.

If I have answered your question, please mark my post as Solved.
If you like my response, please give it a Thumbs Up.

My blog site about Power Automate: https://powerautomatejoy.com/

BR,

Marco

View solution in original post

2 REPLIES 2
MarconettiMarco
Super User
Super User

Hello @Ggim ,

in regards of the dates that are represented by an integer, you should use the following expression:

addDays('1899-12-30','<your_value>','dd/MM/yyyy')

It means that you have to add 447744 days to the base date.

 

Please let me know if the issue is fixed.

If I have answered your question, please mark my post as Solved.
If you like my response, please give it a Thumbs Up.

My blog site about Power Automate: https://powerautomatejoy.com/

BR,

Marco

It worked!

 

In case it might be useful to someone, I also found this article on how to convert dates to Excel Number, so they can be read later as Excel dates, and then use the expression you provided to work with them.

 

Thanks for your reply, best regards

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (3,697)