Calculate Months since a certain date

lwilt

Board Regular
Joined
May 16, 2013
Messages
187
I'm trying to find a way to calculate the months since a certain date. I would like the final formula to look similar to:

Pt:IIF([Avg Order]>=601,5,IIF([Avg Order]>=351,4,IIF([Avg Order]>=201,3,IIF([Avg Order]>=100,2,IIF([Avg Order]>0,1,0)))))

but based on dates.

Date ranges would be something like last 6 months, 7 to 12 months ago, 13 to 24 months ago, 25 to 36 months ago, ect where the most recent data range would be at the beginning.

Is there a function to create the current date so I don't have to type it in every time I run the queries?

Is there a function to see how many months have passed since the date field I'm looking at and comparing to the current date?

Or would you just subtract the 2 date fields and then divide by 30 to have a rough idea of the number of months that have passed?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi,

To get the current date, use the function: TODAY()

To calculate the number of months between today and the past date, use the function: =DATEDIF(Past date,TODAY(),"M")
 
Upvote 0
I can't get the TODAY function to work....every time I type it in a blank field to get that date it doesn't work
 
Upvote 0
It should be entered followed by =, like =today()

Please let me know the version of Excel and is it Windows or Mac ?
 
Upvote 0
Oh !,

I did not check the forum title, Hope someone could help you.
 
Upvote 0
appreciate it....didnt realize in access I had to do the Date function in the table itself and not the query
 
Upvote 0

Forum statistics

Threads
1,221,905
Messages
6,162,770
Members
451,786
Latest member
CALEB23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top