Month: Word to Number

Sarah K

New Member
Joined
Nov 26, 2008
Messages
24
Is there a formula in Excel VB that will allow me to convert a month's name to its numberic equivalent?

So for example:
October to 10
June to 6 etc...


I know I can do a lookup or something, but it there anything slicker?
Any help would be great
 
What if I need the "reverse" in a w/s cell ??
That's to say: month Number to Word.

For example:
9 to September
12 to December
etc.

Let us say:
in D12 I have: 30/09/2011
in D13 I have: Month(D12) which returns 9
and I want it to return September instead.
I tried to reverse your formula, but didn't work!

Regards.
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
What if I need the "reverse" in a w/s cell ??
That's to say: month Number to Word.

For example:
9 to September
12 to December
etc.

Let us say:
in D12 I have: 30/09/2011
in D13 I have: Month(D12) which returns 9
and I want it to return September instead.
I tried to reverse your formula, but didn't work!

Regards.

If you already have the actual date in D12, use

=TEXT(D12,"mmmm")
 
Upvote 0
What if I need the "reverse" in a w/s cell ??
That's to say: month Number to Word.

For example:
9 to September
12 to December
etc.

Let us say:
in D12 I have: 30/09/2011
in D13 I have: Month(D12) which returns 9
and I want it to return September instead.
I tried to reverse your formula, but didn't work!

Regards.
To get the month name from the month number...

Book1
AB
11January
22February
33March
44April
55May
66June
77July
88August
99September
1010October
1111November
1212December
Sheet1

=TEXT(A1*29,"mmmm")
 
Upvote 0
Biff;

Let us assume I don't have the actual date in D12
And let us assume I only have the month number returned in D13 as 9

To use your formula, I'd fill in the number/name month table in F21:G32 as per your reply
What is the formula I should enter in D20 to return the month name based on the month number of D13 and the table F21:G32 ??
{Not sure sure how to use TEXT() here as you suggested instead VLOOKUP()}

Regards.
 
Upvote 0
Biff;

Let us assume I don't have the actual date in D12
And let us assume I only have the month number returned in D13 as 9

To use your formula, I'd fill in the number/name month table in F21:G32 as per your reply
What is the formula I should enter in D20 to return the month name based on the month number of D13 and the table F21:G32 ??
{Not sure sure how to use TEXT() here as you suggested instead VLOOKUP()}

Regards.
I may not have been clear in my other post.

I should have said:

Enter this formula in B1 and copy down to B12:

=TEXT(A1*29,"mmmm")

You don't need a lookup table to do this. The general formula is:

=TEXT(month_number*29,"mmmm")

To answer your question about using a table...

D13 = the month number, a number from 1 to 12

The lookup table in the range F21:G32

One of these:

=INDEX(G21:G32,D13)
=VLOOKUP(D13,F21:G32,2,0)

Of those, the INDEX version would be my choice.
 
Upvote 0
Biff;

Thank you for the clarification.
Let us assume I don't have the actual date in D12
(otherwise, jonmo1's suggested formula would apply: =TEXT(D12,"mmmm")
And let us assume I only have the month number returned in D13 as 9
In this case, your suggested formula applies: =TEXT(D13*29,"mmmm")

There's no need really to create the month number/name table!
That was the confusing part.

Thanks again for your help.
 
Upvote 0
Biff;

Thank you for the clarification.
In this case, your suggested formula applies: =TEXT(D13*29,"mmmm")

There's no need really to create the month number/name table!
That was the confusing part.

Thanks again for your help.
You're welcome! :cool:
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,738
Members
452,940
Latest member
Lawrenceiow

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