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

Convert Date Value in Excel To Date Value in Power Automate

Hello,

 

how to convert date value in my excel to date value in power automate, here is my date value in excel 

Capture321.PNG

and here is my value in power automate using date value in my excel 

Capture2.1.PNG

Capture2.3.PNG

how to convert it ? thank you 

 

9 REPLIES 9
Highlighted
Super User II
Super User II

Hi @AdhamFH 

 

The number represented is the number of days since 1-1-1900. To get a valid date you can do it in one formula, but I'll split into 2 so that it's easier to understand:

 

Get the start date:

formatDateTime('1-1-1900','dd-MM-yyyy')

Get the current date:

addDays(outputs('Compose'),sub(<Excel NUMBER>,1))

 

You'll add the excel number to the start date. You need to decrease by one since its the elapsed number of days, so if you only add the days, you'll get tomorrow instead of today.

 

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

Cheers
Manuel

Highlighted

@manuelstgomes  thank you for your response, but i still dont get it, could you please show it using power automate?

Highlighted

Sure here you go.

 

2020-03-11 14_38_49-Window.png

 

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

Cheers
Manuel

Highlighted

What if i use excel connector to get my date value ? @manuelstgomes
Highlighted

@manuelstgomes actually i use excel connector in compose and i got that '43901' value how to convert it because i want to make condition between my date which stored in my excel and today's date. how should i do to reach that

Highlighted

Hi @AdhamFH 

 

Also a strategy. I wrote an article a while ago that used Excel's connector to parse information provided from Power Automate to get the next business day, but the strategy is exactly the same.

https://manueltgomes.com/microsoft/powerautomate/find-next-business-day/

 

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

Cheers
Manuel

Highlighted

HI @AdhamFH 

 

Were you able to solve this issue?

 

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

Cheers
Manuel

Highlighted

I will give you a thumbs up for sure as this fixed the exact same issue.   

 

 

Tasks excel table deadline column.PNG

 

I had to add in addtional step since PA treats me Deadline date as string, so I made it an integer

 

Get excel date as a valid date.png

 

Thereafter I can compare my deadline date with today as it is in the correct format.  Some peeps might say that is a lot of steps just to compare two dates .... 🙄

 

ticks(outputs('Get_Deadline_Date'))

 

 

 

 

Highlighted

Hi @westerdaled 

 

I agree with your step-by-step approach. In each step you can see what value is converted and it's easier to debug.

 

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

Cheers
Manuel

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Users online (7,752)