Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Calculating numerical month (1 to 12) from text date

I have extracted the month from the worksheet name using the CELL function to
give me the month name as text. Is there a way I can convert this to a
numerical month?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Calculating numerical month (1 to 12) from text date

If you list those months in order in a block of cells somewhere, eg
starting in X1:

January
February
March

etc., then you can use this:

=MATCH(TRIM(D2),X$1:X$12,0)

assuming your months are in column D. Copy down as required.

Hope this helps.

Pete

On Oct 29, 8:49*am, Claire_S
wrote:
I have extracted the month from the worksheet name using the CELL function to
give me the month name as text. Is there a way I can convert this to a
numerical month?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Calculating numerical month (1 to 12) from text date

=MONTH(DATEVALUE("1 "&A1&" 2000"))
--
David Biddulph

"Claire_S" wrote in message
...
I have extracted the month from the worksheet name using the CELL function
to
give me the month name as text. Is there a way I can convert this to a
numerical month?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Calculating numerical month (1 to 12) from text date

Say the file name is something like 18 January 1863.xls

In B1 thru B3 enter:

=CELL("filename",A1)
=MID(B1,47,15)
=MONTH(DATEVALUE(B2))

to display:

C:\Documents and Settings\Owner\My Documents\[18 January 1963.xls]Sheet1
18 January 1963
1

This gets you the "1" for January.
--
Gary''s Student - gsnu200908


"Claire_S" wrote:

I have extracted the month from the worksheet name using the CELL function to
give me the month name as text. Is there a way I can convert this to a
numerical month?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Calculating numerical month (1 to 12) from text date

But wouldn't that get screwed up if the next filename was 8 May 2007.xls?
--
David Biddulph

Gary''s Student wrote:
Say the file name is something like 18 January 1863.xls

In B1 thru B3 enter:

=CELL("filename",A1)
=MID(B1,47,15)
=MONTH(DATEVALUE(B2))

to display:

C:\Documents and Settings\Owner\My Documents\[18 January
1963.xls]Sheet1 18 January 1963
1

This gets you the "1" for January.

I have extracted the month from the worksheet name using the CELL
function to give me the month name as text. Is there a way I can
convert this to a numerical month?





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Calculating numerical month (1 to 12) from text date

On Oct 29, 8:44*pm, "David Biddulph" <groups [at] biddulph.org.uk
wrote:
But wouldn't that get screwed up if the next filename was 8 May 2007.xls?
--
David Biddulph



Gary''s Student wrote:
Say the file name is something like 18 January 1863.xls


In B1 thru B3 enter:


=CELL("filename",A1)
=MID(B1,47,15)
=MONTH(DATEVALUE(B2))


to display:


C:\Documents and Settings\Owner\My Documents\[18 January
1963.xls]Sheet1 18 January 1963
1


This gets you the "1" for January.


I have extracted the month from the worksheet name using the CELL
function to give me the month name as text. Is there a way I can
convert this to a numerical month?- Hide quoted text -


- Show quoted text -


With text month in A1

=MONTH(A1&1)
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
Calculating month to date Johan Excel Worksheet Functions 3 November 1st 08 09:35 AM
calculating month of present date anu_manu Excel Discussion (Misc queries) 5 February 24th 06 07:04 PM
Calculating Month To Date Revenue Mike Excel Worksheet Functions 4 January 31st 06 03:57 PM
Calculating recurring date in following month, calculating # days in that period Walterius Excel Worksheet Functions 6 June 4th 05 11:21 PM
How do I format cells from numerical dates to text month in a dif. johntokay Charts and Charting in Excel 4 April 11th 05 09:51 PM


All times are GMT +1. The time now is 02:09 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"