How to extract month number from month name

P

PM

I have a workbook that have multiple workshhets in it. The worksheets are
called January, February, March ..... (Please note thare are a couple of
worksheets which are not month related). Within each month sheet I have a
column that has a reference number 01 for Jan, 02 for Feb, 03 for March... At
the moment the reference numbers are typed in manually.

Is there a way where I can extract the month number from the month name and
automatically insert it into the reference number column?

Any help would be appreciated.
 
B

Bob Phillips

This formula will extract the month name from the sheet tab and calculate
its index

=MONTH(DAY(TODAY())&"-"&MID(CELL("filename",A1),FIND("]",CELL("filename",A1)
)+1,255)&"-"&YEAR(TODAY()))

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
P

PM

Bob,

Many thanks for you time and formula, works a treat.

Pank

Bob Phillips said:
This formula will extract the month name from the sheet tab and calculate
its index

=MONTH(DAY(TODAY())&"-"&MID(CELL("filename",A1),FIND("]",CELL("filename",A1)
)+1,255)&"-"&YEAR(TODAY()))

--

HTH

RP
(remove nothere from the email address if mailing direct)


PM said:
I have a workbook that have multiple workshhets in it. The worksheets are
called January, February, March ..... (Please note thare are a couple of
worksheets which are not month related). Within each month sheet I have a
column that has a reference number 01 for Jan, 02 for Feb, 03 for March... At
the moment the reference numbers are typed in manually.

Is there a way where I can extract the month number from the month name and
automatically insert it into the reference number column?

Any help would be appreciated.
 

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

Top