Month count

Hi, is there a simple expression for counting the number of months between two dates? Specifically, I’m looking to calculate the number of months between Now() and a specified EndDate.

Thanks

Hey Dave.

Not specifically, but you can use TOTALHOURS() to find the number of hours that’s passed, then use that with some math to find the total number of months - but that’s not going to be exact.

Hmmm… I can’t think of any easy way to do this, my mind keeps going to things like: we’ll need to construct a multi-layered IF() statement to handle different situations. Like… if it’s been over a year, or years, then we need to:

  • (count the number of years that’s passed X 12)
  • plus however many months from the start date to the end of THAT year
  • plus the number of months (from the start of the year) to the end month.

Deeper layered things like that to cover all the bases.

Haven’t tested, but something like this should work…
ABS(((YEAR(NOW())-YEAR([Date]))-1)*12+MONTH(NOW())+(12-MONTH([Date])))

2 Likes

I’m always surprised at how seemingly simple solutions quickly become complex. I found this on the AppSheet help archive. It seems to describe what I need, but I’m not clear on using year as a virtual column or what the app formula for that would be.

1 Like

I’ll give that a shot, thanks!