INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

HANDLE


PASSWORD
Remember Me
Forgot Password?

Come Join Us!

  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

E-mail*
Handle

Password
Verify P'word
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Member Feedback

"...This was the ONLY place that I could find information that I could use to resolve the problem. So thanks once again to member TomSark and the SQL forum!..."

Geography

Where in the world do Tek-Tips members come from?

 Excel convert Month Name ("MMM") to Month number (1-12)

skipjakk (TechnicalUser)
27 Jan 09 17:49
Ran into a problem with Excel and dates, I have the month name (as Jan-Dec), and I need to convert it to the month number using a formula, is there any way to do this?
SkipVought (Programmer)
27 Jan 09 19:52



hi,

Build a table of month names.

Use the Match function to return the month number.

Skip,
glassesDon't let the Diatribe...
talk you to death!tongue

glassesJust traded in my old subtlety...
for a NUANCE!tongue

TonyJollans (Programmer)
28 Jan 09 2:31
.. and if you want it all in a single formula, you can build the array on the fly ..

=MATCH(YourCellRef,TEXT(DATE(2000,ROW(1:12),1),"Mmm"),0)

 .. array-entered (with Ctrl+Shift+Enter)

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website

GlennUK (MIS)
28 Jan 09 4:00
Another method:

=MONTH(DATEVALUE("1/"&YourCellRef&"/2000"))

that doesn't need to be an array formula.

Cheers, Glenn.

Beauty is in the eye of the beerholder.

Helpful Member!Helpful Member!Helpful Member!Helpful Member!Helpful Member!xlhelp (Instructor)
28 Jan 09 10:35
If your month name is in cell A2, then =Month(1&A2)

Vita Brevis

anotherhiggins (TechnicalUser)
28 Jan 09 10:58
Verrrrry nice, xlhelp. Short, simple and functional.

->*

-John
    The plural of anecdote is not data

Help us help you. Please read FAQ 181-2886 before posting.

Lilliabeth (TechnicalUser)
28 Jan 09 11:19
Wowie wow wow!

Where do you get these things, xlhelp?

Why does it work?

--Lilliabeth

SkipVought (Programmer)
28 Jan 09 11:23



Whoa, xlhelp!  ==> *

Can you 'splain that?

Skip,
glassesDon't let the Diatribe...
talk you to death!tongue

glassesJust traded in my old subtlety...
for a NUANCE!tongue

anotherhiggins (TechnicalUser)
28 Jan 09 11:23
If I may....

It returns 1Feb. Go type 1Feb into Excel. Excel will automatically change it to 1-Feb, a date.

Now, concatenating 1 & "Feb" will only return the string "1Feb" - not a date.

But - wrapping the concatenation 1 & "Feb" inside the MONTH function coerces the string back into a date, of which it then returns the month number.

-John
    The plural of anecdote is not data

Help us help you. Please read FAQ 181-2886 before posting.

SkipVought (Programmer)
28 Jan 09 11:30



Thanks, John.

Skip,
glassesDon't let the Diatribe...
talk you to death!tongue

glassesJust traded in my old subtlety...
for a NUANCE!tongue

TonyJollans (Programmer)
28 Jan 09 12:07
Nice, xlhelp, have a star.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website

Stella740pl (Programmer)
28 Jan 09 13:32

And it works great with a full name of the month, too - just tested.
Helpful Member!Helpful Member!Helpful Member!Helpful Member!Helpful Member!xlhelp (Instructor)
29 Jan 09 11:03
You guys are too kind. Thank you though; celestial objects(*) definitely lift your spirits.

To 'splain it: I don't believe I could have articulated any better than John. Basically it's the same as saying =Month((1&Cellref)*1). The downside of it is that it gives you the first of the month for the current year. I use it in a spreadsheet where I don't care what date it translates to.

Vita Brevis

SkipVought (Programmer)
29 Jan 09 11:31


I like to know all these nuances.

One of my favorite useful ones is entering Jan 2009, then drag the "copy box" down.

Result, the FIRST of every month following.

Skip,
glassesDon't let the Diatribe...
talk you to death!tongue

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Start A New Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Promoting, selling, recruiting and student posting
are not allowed in the forums.
Posting Policies

LINK TO THIS FORUM!
(Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum)
TITLE: Microsoft: Office Forum at Tek-Tips
URL: http://www.tek-tips.com/threadminder.cfm?pid=68
DESCRIPTION: Microsoft: Office technical support forum and mutual help system for computer professionals. Selling and recruiting forbidden.