I’ve created myself an Excel table with some dates in it. i will use this example Excel file during the rest of my post.
Read dates from Excel with Power Automate 1
Read dates from Excel
In general when I read Excel files from SharePoint or OneDrive I would use Microsoft Graph, but for this example I will use the out of the box actions. in both cases Excel will return numbers as we will shortly see.
Using the List rows present in a table action I’m getting all the rows from my excel file. I’m then using a compose action to display the results. this isn’t 100% needed, but it makes debugging just that little bit easier.
Read dates from Excel with Power Automate 2
Running the above two steps, now gives me tat number that I have been talking about. The 28 October 2020 is day 44132 as you can see below.
Read dates from Excel with Power Automate 3
Setting a base date
I’m going to set my base date to 2020-10-28, but really you could set this to any date.
Read dates from Excel with Power Automate 4
Calculating the dates
Now to calculate each date from that number that Excel gives me, I’m using the following steps.
Read dates from Excel with Power Automate 5
The first step is a Compose action that contains the day from the row in my excel.
In the second compose I’m calculating the number of days since my base day using the following expression, using the sub function.
Is your business still running on paper trails, sprawling Excel files, or ageing Access databases? There's a better way — and I can show you exactly what it looks like.
I'm the Technical Director of Vantage 365, a Microsoft solutions consultancy working with clients across the UK, the Netherlands, and worldwide.
For over 30 years I've been turning messy, manual business processes into clean, automated systems that save time, reduce errors, and give teams the visibility they need to make better decisions.
SharePains is not just any blog run by a Microsoft MVP. Have you ever used Try-Catch in Power Automate? The original post about Try-Catch in Power Automate can still be found on this site, https://sharepains.com/2018/02/07/try-catch-finally-in-power-automate-flow/
Or have you ever used the Pieter’s method to avoid variables and speed up your flows? https://sharepains.com/2020/03/11/pieters-method-for-advanced-in-flows/
You can contact me using contact@sharepains.com
Is your business still running on paper trails, sprawling Excel files, or ageing Access databases? There's a better way — and I can show you exactly what it looks like.
I'm the Technical Director of Vantage 365, a Microsoft solutions consultancy working with clients across the UK, the Netherlands, and worldwide.
For over 30 years I've been turning messy, manual business processes into clean, automated systems that save time, reduce errors, and give teams the visibility they need to make better decisions.
SharePains is not just any blog run by a Microsoft MVP. Have you ever used Try-Catch in Power Automate? The original post about Try-Catch in Power Automate can still be found on this site, https://sharepains.com/2018/02/07/try-catch-finally-in-power-automate-flow/
Or have you ever used the Pieter’s method to avoid variables and speed up your flows? https://sharepains.com/2020/03/11/pieters-method-for-advanced-in-flows/
You can contact me using contact@sharepains.com
Thanks for sharing this method.
Hopefully Microsoft will add better date handling capabilities in the future when reading from Excel.
Upon investigating further, why not simply have one compose action with the following expression
addDays(‘1899-12-30’, 44132, ‘dd-MM-yyyy’)
?
Have you noticed the option to switch between the two dat format options?
https://sharepains.com/2021/06/21/insert-dates-into-excel-power-automate/
Hello, an example:
in column A I have the date and in column B I have a text
How do I calculate the date that the user enters and returns the text of column B.
Within Power Automate you can now read date fields using the ISO standard rather than the Excel number. That should help you a bit