cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
eduardodsx Advocate I
Advocate I

Excel Days360() function equivalent in PowerApps

Can anyone help me? I need the equivalent of this Excel function in PowerApps.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Excel Days360() function equivalent in PowerApps

Hi @eduardodsx ,

Yeah, you are right. The DateDiff function would not consider 30 days for every month. If you would like the DataDiff function to consider 30 days for every month within your app, I afraid that there is no way to achieve your needs in PowerApps currently.

 

If you would like this feature to be added in PowerApps, please consider submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas

 

As an alternative solution, you could consider take a try with the following workaround:

If(
   Month(StartDate) = 1 || Month(StartDate) = 3 || Month(StartDate) = 5 || Month(StartDate) = 7 || Month(StartDate) = 8 || Month(StartDate) = 10 || Month(StartDate) = 12,
   DateDiff(StartDate, EndDate, Days) - 1,   // remove the difference -- 1 day
   DateDiff(StartDate, EndDate, Days)
)

Note: Detect if current month has 31 days or 30 days, if it has 31 days, minus 1 day from the DateDiff(...) result.

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
EricLott Resident Rockstar
Resident Rockstar

Re: Excel Days360() function equivalent in PowerApps

Try this

DateDiff(Date1,Date2,Days)
Community Support
Community Support

Re: Excel Days360() function equivalent in PowerApps

Hi @eduardodsx ,

The Days360 function in Excel is equivalent to DateDiff function in PowerApps.

 

The standard formula of DateDiff function as below:

DateDiff( StartDateTime, EndDateTime [, Units ] )

Note: The type of Units to add: MillisecondsSecondsMinutesHoursDaysMonthsQuarters, or Years. If not specified, Days are used.

 

Please consider take a try with above function, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
eduardodsx Advocate I
Advocate I

Re: Excel Days360() function equivalent in PowerApps

DateDiff() doesn't work because days360() considers 30 days for every month. 

 

Example: from december to january as december has 31 days will give difference in the calculation compared to Excel.

EricLott Resident Rockstar
Resident Rockstar

Re: Excel Days360() function equivalent in PowerApps

Use DateDiff(Date1, Date2, Months) * 30
Community Support
Community Support

Re: Excel Days360() function equivalent in PowerApps

Hi @eduardodsx ,

Yeah, you are right. The DateDiff function would not consider 30 days for every month. If you would like the DataDiff function to consider 30 days for every month within your app, I afraid that there is no way to achieve your needs in PowerApps currently.

 

If you would like this feature to be added in PowerApps, please consider submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas

 

As an alternative solution, you could consider take a try with the following workaround:

If(
   Month(StartDate) = 1 || Month(StartDate) = 3 || Month(StartDate) = 5 || Month(StartDate) = 7 || Month(StartDate) = 8 || Month(StartDate) = 10 || Month(StartDate) = 12,
   DateDiff(StartDate, EndDate, Days) - 1,   // remove the difference -- 1 day
   DateDiff(StartDate, EndDate, Days)
)

Note: Detect if current month has 31 days or 30 days, if it has 31 days, minus 1 day from the DateDiff(...) result.

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (7,363)