Converting month name to a number

azizrasul

Well-known Member
Joined
Jul 7, 2003
Messages
1,304
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
I have a column of data that includes month names for 1 year which do not appear in the correct order i.e. Jan, Feb, Mar etc.

In an adjacent column I want to have a formula that will give me the month number so that I can sort the column in the correct monthly order.

The reason behind getting the correct order is that I have another column containing some numbers which I want manipulate in code.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Excel 2007

Column A
OK, assuming A1:A5, follow this carefully ..

1. Select A1:A5
2. On the Data ribbon tab click the big 'Sort' button.
3. Ensure 'My data has headings' is checked near the top right of the Sort dialog.
4. Click the drop-down arrow in the 'Order' section at the right.
5. Click 'Custom List...'
6. Click on the January, February, March, ... list
7. OK
8. OK

The result for me is

Excel Workbook
A
1MTHNAME
2April
3May
4June
5July
6
Sort
 
Upvote 0
That's exactly what I tried and it didn't work. I tried it again just to be sure I wasn't doing anything silly, but still didn't work.
 
Upvote 0
OK I know what I was doing wrong. I was selecting Jan, Feb, etc. in the custom list and not January, February, etc.

Thanks Peter and Paul.
 
Upvote 0
That's exactly what I tried and it didn't work.
When you say it didn't work, what happened? Nothing? A message?

Can you confirm that in the Custom List you chose the list with full month names, not
Jan, Feb, Mar, ...?

Edit: OK, I missed your last post. I can see now this was the problem. (I did say to follow the steps carefully. ;) )
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,147
Members
452,891
Latest member
JUSTOUTOFMYREACH

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