cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Handling Excel Online Dates

I am attempting to List Rows present in a table, one of those columns is formatted as date, and based on that date I will trigger emails in X number of days.

The problem is Flow doesn't like the date column and converts it into a number.  I have scoured the forums looking for a solution but there doesn't appear to be a simple one (I can understand at least).

Can you advise how I import the data retaining the date format so Flow can then understand when to send the emails?

Currently I have a work around of formatting the column as General and using text but this seems illogical.

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @Smudgers9 

You're right! Therefore we shoud substract a couple of days inside the expression, using the sub function:

addDays('01/01/1900',sub(int(items('apply_to_each')?['Order Date']),2),'dd/MM/yyyy')

 

I've tested on my own and it works.

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

View solution in original post

6 REPLIES 6
Super User II
Super User II

Hello @Smudgers9 

Excel stores internally the dates as sequential serial numbers starting from January 1, 1900. Therefore, you should convert this number to a date in Power Automate, and then proceed with what you want to do. Have a look at this sample:

dates.png

 

You can use the following expression to convert an excel date column (called "Order Date"):

 

addDays('01/01/1900',int(items('apply_to_each')?['Order Date']),'dd/MM/yyyy')

 

 

Although I'm using 01/12/1900 as the start date, you might find that 2 days are added to your excel dates. So, use 30/12/1899 as the start date if you find this issue.

 

Hope it helps!

Ferran

 

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Hi @fchopo 

 

Yes the return date is coming back 2 days ahead of the date entered into the "Order Date" column.  

 

It won't let me use 30/12/1899 as the date as it errors with the below.

Smudgers9_1-1607004146130.png

 

 

 

Hello @Smudgers9 

You're right! Therefore we shoud substract a couple of days inside the expression, using the sub function:

addDays('01/01/1900',sub(int(items('apply_to_each')?['Order Date']),2),'dd/MM/yyyy')

 

I've tested on my own and it works.

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

View solution in original post

Brilliant, yes that works and now updating but can you clarify one last thing please?

 

Both columns are formatted as English United Kingdom with 14/03/2020 selected as the Type (see below) but both columns give different results.

 

The results in Stage1 Date Sent displays in the cell as "MM/dd/yyyy" but when you enter the cell in the formula bar it shows "dd/MM/yyyy".

The add days to Stage1 Date Sent is using 'dd/MM/yyyy' too so should be correct.

Screenshot 2020-12-08 125139.jpg

And the opposite is true for Chase1 Email Sent where the cell shows "dd/MM/yyyy" but when entering the cell the formula bar shows "MM/dd/yyyy"
4.jpg

3.jpg2.jpg

 

Hope that makes sense

 

So a weird workaround for this is to use dd/MMM/yyyy as the format within Flow which generates the date as 08 December 2020 for example and removes the problem between recognising US and UK dates.  Not ideal but it seems to work.

 

If anyone has a better suggestion I would like to hear it.

 

One thing I didn't mention which is crucial but this is when using Excel Online via a browser.  If I download and open with the local App then it formats the dates correctly.  The internet seems to be littered with others having the same issues and complaints.  Perhaps I have missed the solution somewhere.

Hello @Smudgers9 

When working with dates in Power Automate, you should always work with ISO 8601 format (yyyy-MM-dd). On the other hand, when working with Excel Online, it is going to show the dates depending on the language in your browser, your account information (Excel Online - changing date format - Office Watch (office-watch.com)) and the SharePoint/OneDrive regional settings (Change regional settings for a site - Office Support (microsoft.com))

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (29,724)