Converting month name to number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I transfer the month name February in a cell to its corresponding
number 2, March to 3, etc, so I can use it in a formula in another cell?
 
With
A1: (a month name....eg March)

Try this
=MONTH("01-"&A17)

In my example the formula returns: 3


Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
 
In case it isn't obvious....

My formula should reference A1, instead of cell A17

=MONTH("01-"&A1)

Regards,

Ron
Microsoft MVP (Excel)
 
Ron Coderre said:
With
A1: (a month name....eg March)

Try this
=MONTH("01-"&A17)

Sorry Ron but I can't get that to work. A17 must be an error, right?
 
Just another way:

=MONTH(A1&0)

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
A1: (a month name....eg March)
Try this
=MONTH("01-"&A1)

In my example the formula returns: 3

Looks like you can shorten your formula a tad more; this seems to work...

=MONTH("1"&A4)

Rick
 
Ron Coderre said:
With
A1: (a month name....eg March)

Try this
=MONTH("01-"&A17)

Thanks Ron, it worked now.
I had the cell Date formatted, it should be General!
Simple and swift, nice!
Best regards
Mats
 
A1: (a month name....eg March)
Looks like you can shorten your formula a tad more; this seems to work...

=MONTH("1"&A4)

Actually, the quote marks are not needed...

=MONTH(1&A4)

Rick
 
You're right....by fussing with a character here and there the formula can
be shortened. However, for something this basic, I went with a fairly
intuitive, non-ambiguous, easily remembered date format that Excel would
properly translate (eg "01-March").

Regards,

Ron
Microsoft MVP (Excel)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top