cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

CONVERT FORMULA

Good Day!
Need help please..

How to convert this Excel formula to PowerApps formula

=Datedif(StartDate,Endate+1,"y")
=Datedif(StartDate,Endate+1,"ym")
=Datedif(StartDate,Endate+1,"md")

asd.png

 

thanks and Advance!,,,

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

Hi @DHAGZ ,

 

You could try this formula instead of “=Datedif(StartDate,Endate+1,"y")

DateDiff(DatePicker1.SelectedDate,DatePicker2.SelectedDate,Years)

v-xiaochen-msft_0-1610934730371.png

 

 

You could try this formula instead of “=Datedif(StartDate,Endate+1,"ym")

Abs(Month(DatePicker2.SelectedDate)-Month(DatePicker1.SelectedDate))

v-xiaochen-msft_1-1610934730374.png

 

 

You could try this formula instead of “=Datedif(StartDate,Endate+1,"md")

Abs(Day(DatePicker2.SelectedDate)-Day(DatePicker1.SelectedDate))

v-xiaochen-msft_2-1610934730376.png

 

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

2 REPLIES 2
Microsoft
Microsoft

Hi @DHAGZ ,

 

You could try this formula instead of “=Datedif(StartDate,Endate+1,"y")

DateDiff(DatePicker1.SelectedDate,DatePicker2.SelectedDate,Years)

v-xiaochen-msft_0-1610934730371.png

 

 

You could try this formula instead of “=Datedif(StartDate,Endate+1,"ym")

Abs(Month(DatePicker2.SelectedDate)-Month(DatePicker1.SelectedDate))

v-xiaochen-msft_1-1610934730374.png

 

 

You could try this formula instead of “=Datedif(StartDate,Endate+1,"md")

Abs(Day(DatePicker2.SelectedDate)-Day(DatePicker1.SelectedDate))

v-xiaochen-msft_2-1610934730376.png

 

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

Dual Super User II
Dual Super User II

Hi @DHAGZ 

 

You can use DateDiff function to get the difference between two dates. To get more details on DateDiff function, you can refer: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-dateadd-datediff

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (74,740)