Forum

DAX Datedif functio...
 
Notifications
Clear all

DAX Datedif function for Excel 2010

3 Posts
2 Users
0 Reactions
66 Views
(@mwelsh)
Posts: 16
Eminent Member
Topic starter
 

I'm looking for the Excel equivalent of DATEDIF. e.g

=DATEDIF("21/01/02","07/10/16","m")

In Excel 2016 DAX supports the DATEDIFF function =DATEDIFF("21/01/02","07/10/16",month)

but this is not supported in Excel 2010. Is there a simple way to achieve this?

Cheers,

Martin

 
Posted : 08/10/2016 1:15 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Martin,

This formula will round up:

=(YEAR([Date2])-YEAR([Date1]))*12+MONTH([Date2])-MONTH([Date1])

And this will round down:

=IF(DAY([Date2])>=DAY([Date1]),0,-1)+(YEAR([Date2])-YEAR([Date1]) ) * 12 + MONTH([Date2]) - MONTH([Date1])

Source: http://www.powerpivot-info.com/post/143-q-how-can-i-calculate-difference-between-two-dates-in-dax-seconds-minutes-hours-days-and-months

Kind regards,

Mynda

 
Posted : 10/10/2016 6:03 am
(@mwelsh)
Posts: 16
Eminent Member
Topic starter
 

Thanks Mynda.....This is what I need Laugh

 
Posted : 12/10/2016 9:03 pm
Share: