Month Function - Please help

Dude 2 Excel Dude

New Member
Joined
Apr 21, 2014
Messages
8
I have a database where my information is up to Aug-17.

If I use the Month function in Aug-17 the result will be 8.

However, I want the latest month available have a result 1.

This means that if I have historical information, the previous months also reclassify.

[TABLE="width: 268"]
<tbody>[TR]
[TD]Month[/TD]
[TD]Result Month #[/TD]
[/TR]
[TR]
[TD]Jul-16[/TD]
[TD="align: right"]14[/TD]
[/TR]
[TR]
[TD]Aug-16[/TD]
[TD="align: right"]13[/TD]
[/TR]
[TR]
[TD]Sep-16[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD]Oct-16[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD]Nov-16[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Dec-16[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD]Jan-17[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]Feb-17[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD]Mar-17[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD]Apr-17[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]May-17[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]Jun-17[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]Jul-17[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]Aug-17[/TD]
[TD="align: right"]1[/TD]
[/TR]
</tbody>[/TABLE]


If my latest information was up to Sep-17 this would be the resulta:
[TABLE="width: 165"]
<tbody>[TR]
[TD]Month[/TD]
[TD]Result Month #[/TD]
[/TR]
[TR]
[TD]Jul-16[/TD]
[TD="align: right"]15[/TD]
[/TR]
[TR]
[TD]Aug-16[/TD]
[TD="align: right"]14[/TD]
[/TR]
[TR]
[TD]Sep-16[/TD]
[TD="align: right"]13[/TD]
[/TR]
[TR]
[TD]Oct-16[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD]Nov-16[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD]Dec-16[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Jan-17[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD]Feb-17[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]Mar-17[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD]Apr-17[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD]May-17[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]Jun-17[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]Jul-17[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]Aug-17[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]Sep-17[/TD]
[TD="align: right"]1
[/TD]
[/TR]
</tbody>[/TABLE]

Thanks in advance,
Dude
 
Last edited:

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Try this...
[Table="width:, class:grid"][tr][td] [/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][/tr]
[tr][td]
1​
[/td][td]Month[/td][td]Result Month #[/td][td][/td][/tr]

[tr][td]
2​
[/td][td]16-Jul[/td][td]
14​
[/td][td]
14​
[/td][/tr]

[tr][td]
3​
[/td][td]16-Aug[/td][td]
13​
[/td][td]
13​
[/td][/tr]

[tr][td]
4​
[/td][td]16-Sep[/td][td]
12​
[/td][td]
12​
[/td][/tr]

[tr][td]
5​
[/td][td]16-Oct[/td][td]
11​
[/td][td]
11​
[/td][/tr]

[tr][td]
6​
[/td][td]16-Nov[/td][td]
10​
[/td][td]
10​
[/td][/tr]

[tr][td]
7​
[/td][td]16-Dec[/td][td]
9​
[/td][td]
9​
[/td][/tr]

[tr][td]
8​
[/td][td]17-Jan[/td][td]
8​
[/td][td]
8​
[/td][/tr]

[tr][td]
9​
[/td][td]17-Feb[/td][td]
7​
[/td][td]
7​
[/td][/tr]

[tr][td]
10​
[/td][td]17-Mar[/td][td]
6​
[/td][td]
6​
[/td][/tr]

[tr][td]
11​
[/td][td]17-Apr[/td][td]
5​
[/td][td]
5​
[/td][/tr]

[tr][td]
12​
[/td][td]17-May[/td][td]
4​
[/td][td]
4​
[/td][/tr]

[tr][td]
13​
[/td][td]17-Jun[/td][td]
3​
[/td][td]
3​
[/td][/tr]

[tr][td]
14​
[/td][td]17-Jul[/td][td]
2​
[/td][td]
2​
[/td][/tr]

[tr][td]
15​
[/td][td]17-Aug[/td][td]
1​
[/td][td]
1​
[/td][/tr]

[tr][td]
16​
[/td][td][/td][td][/td][td][/td][/tr]
[/table]

C2=IF(A2="","",IF(A2=MAX(A:A),1,C3+1))
copied down as needed
 
Upvote 0
Or this (assuming your month dates are uniform -- say, 1st of the month):

=IF(A2="","",DATEDIF(A2,MAX(A:A),"m")+1)
 
Upvote 0

Forum statistics

Threads
1,225,773
Messages
6,186,944
Members
453,391
Latest member
patricktoulon1

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