OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Changing Month (Text form) to Month (Number form)

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
seancm
General User
General User


Joined: 26 Sep 2006
Posts: 7

PostPosted: Tue Oct 03, 2006 9:10 am    Post subject: Changing Month (Text form) to Month (Number form) Reply with quote

Is there a way to take a month in it's text form (ie. "January", "March", etc...) and get its number form from it (ie. 1, 3, etc...)?

I have tried various things (of course I have no idea what I am doing but have tried anyway) but have not been able to find a way to do it.

Some things I have tried:

MONTH(DATE(2006;March;1))
MONTH(March)

And a few other that I can no longer remember.

Thanks in advance.

Sean
Back to top
View user's profile Send private message
acknak
Moderator
Moderator


Joined: 13 Aug 2004
Posts: 4295
Location: ~ 40°N,75°W

PostPosted: Tue Oct 03, 2006 9:58 am    Post subject: Reply with quote

Code:
=MONTH(DATEVALUE("jan 1"))
Works, but
Code:
=MONTH(DATEVALUE("jan"))
doesn't. You need at least a day number to get a valid date. If you can take the month name from another cell and stick on an arbitrary day number, it should work. Like so:
Code:
=MONTH(DATEVALUE(A1&" 1"))
.
You can also set up a table of (Month_Name, Month_Number) and use VLOOKUP.
Back to top
View user's profile Send private message
seancm
General User
General User


Joined: 26 Sep 2006
Posts: 7

PostPosted: Tue Oct 03, 2006 10:16 am    Post subject: Reply with quote

Thanks that worked great.

Sean
Back to top
View user's profile Send private message
carl
Super User
Super User


Joined: 21 Apr 2003
Posts: 920
Location: Germany

PostPosted: Tue Oct 03, 2006 11:20 pm    Post subject: Reply with quote

you could enter the month as a date ie 01.01.06
and then FORMAT it as any of the date formats (including "January")
_________________
carl
Using OpenOffice.org 2 on XP sp2
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group