Assigning a number to a date within a date range

jimbogarner

Board Regular
Joined
Apr 22, 2010
Messages
100
Hi,

I am trying to find a formula that assigns a number to a date depending on where it falls in a date range, for example;

In the range October-20 > September-21 - the month of December-20 would be month 3... in the range December-20 > November-21 the month of December-20 would be month 1...

Is this feasible?

Thanks,

James
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Try this:-

20210506 Count Months.xlsx
ABCDE
1Start PeriodEnd PeriodMonthMonth No
2Oct-20Sep-21Dec-203
3
Sheet1
Cell Formulas
RangeFormula
D2D2=DATEDIF(A2,C2,"m")+1
 
Upvote 0
=DATEDIF(A2,C2,"m")+1
Thanks, this seems to just return Jan-00 everytime, am I doing something totally wrong?
1620313276701.png


Thanks,

James
 
Upvote 0
Change the cell format to General.
 
Upvote 0

Forum statistics

Threads
1,214,786
Messages
6,121,548
Members
449,038
Latest member
Guest1337

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