Hello,
how to convert date value in my excel to date value in power automate, here is my date value in excel
and here is my value in power automate using date value in my excel
how to convert it ? thank you
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.
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 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.
I had to add in addtional step since PA treats me Deadline date as string, so I made it an integer
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
Excel in fact starts counting days since "0-1-1900". So in order to get the correct date you need to subtract 2 Days.
User | Count |
---|---|
26 | |
13 | |
11 | |
9 | |
8 |
User | Count |
---|---|
49 | |
27 | |
22 | |
20 | |
19 |