Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 112
Default Converting month name to number

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?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Converting month name to number

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)

"Mats Samson" wrote in message
...
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?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Converting month name to number

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" wrote in message
...
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)

"Mats Samson" wrote in message
...
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?





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 112
Default Converting month name to number



"Ron Coderre" wrote:

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?

In my example the formula returns: 3


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

Regards,

Ron
Microsoft MVP (Excel)

"Mats Samson" wrote in message
...
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?




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default Converting month name to number

Just another way:

=MONTH(A1&0)

--
HTH

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


Replace @mailinator.com with @tiscali.co.uk


"Mats Samson" wrote in message
...
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?





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default Converting month name to number

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
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 112
Default Converting month name to number



"Ron Coderre" wrote:

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

In my example the formula returns: 3


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

Regards,

Ron
Microsoft MVP (Excel)

"Mats Samson" wrote in message
...
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?




  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default Converting month name to number

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)


Actually, the quote marks are not needed...

=MONTH(1&A4)

Rick
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Converting month name to number

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)


"Rick Rothstein (MVP - VB)" wrote in
message ...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting month name to number runsrealfast Excel Worksheet Functions 3 April 4th 23 02:25 PM
converting workbook from one month to the next braveheartsr Excel Discussion (Misc queries) 1 July 24th 07 12:30 AM
Converting Month Number to Month Text Abbreviation Bob Excel Worksheet Functions 10 May 12th 07 04:11 AM
converting Month name to a number runsrealfast Excel Discussion (Misc queries) 3 June 13th 06 06:34 PM
show month number as month name in Excel? Phil Hart Excel Discussion (Misc queries) 3 June 20th 05 06:12 PM


All times are GMT +1. The time now is 01:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"