Convert an abbreviated month name to an integer

mikeymay

Well-known Member
Joined
Jan 17, 2006
Messages
1,471
I want to convert an abbreviated month name, e.g. Jan, Feb, Mar, etc into an integer that represents the month number, eg Jan = 1, Feb = 2, etc

Seems an easy thing to do the other way round, but am struggling with this.


Thanks
 

Some videos you may like

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

sunnyland

Well-known Member
Joined
Jan 27, 2006
Messages
912
Hello,

2 ways I can think off :
New_Plat_Cust_Form.xls
ABCDE
1MonthCharMonthIntMonthCharMonthInt
2Feb2Jan1
3Mar3Feb2
4Mar3
5Apr4
6May5
7Jun6
8Jul7
9Aug8
10Sep9
11Oct10
12Nov11
13Dec12
New


Formula in B2:
=((A2="Jan")*1)+((A2="Feb")*2)+((A2="Mar")*3) will have to be expanded to ....((a2="Dec)*12)

formula in b3 uses vlookup easier to implement as if you type 1 and drag down to series, you don't have to type .
Same for Jan, drag down will increment the months.
 

Watch MrExcel Video

Forum statistics

Threads
1,114,096
Messages
5,545,926
Members
410,713
Latest member
TaremyLunsil
Top