Function or formula to convert "text" month to number of month?

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

Guest

Is there a function to convert the text name of a month (e.g., "April") to
its corresponding number (e.g., "4")? If not, the only workaround I can
think of would be a long, nested IF function (e.g., =IF(A1="January",
"1",IF(A1="February", "2", . . . etc. . . ))))))))

TIA for any help offered,
Steve
 
Does anoyone know how to do the reverse. Convert month number to text.

Ex: 1 = Jan, 2= Feb
 
There is no built in conversion either way but it is easy to make one

=VLOOKUP(A1,{1,"Jan";2,"Feb";3,"Mar";4,"Apr";5,"May";6,"Jun";7,"Jul";8,"Aug";9,"Sep";10,"Oct";11,"Nov";12,"Dec"},2,0)


with your number in A1

You might want to wrap it in an IF function in case a1 is blank

=IF(A1="","",VLOOKUP(A1,{1,"Jan";2,"Feb";3,"Mar";4,"Apr";5,"May";6,"Jun";7,"Jul";8,"Aug";9,"Sep";10,"Oct";11,"Nov";12,"Dec"},2,0))
 
=text(date(2007,a1,1),"mmm")

if A1 contained the number (1-12).
 

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