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 Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (829)