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
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,019)