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

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
manuelstgomes
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

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

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

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

@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

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

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

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'))

 

 

 

 

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
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (42,140)