Getting a month from a date NOT using month() function! HELP!

  • Thread starter Pedro Sendas Pereira
  • Start date
P

Pedro Sendas Pereira

Hi

Is there a way to get the month from a date without using the month()
function?

If I have this date: 12-10-2003 and I want to get the month 10 withou the
month() function, what do I have to do?

Thank you
 
R

Ron Rosenfeld

Hi

Is there a way to get the month from a date without using the month()
function?

If I have this date: 12-10-2003 and I want to get the month 10 withou the
month() function, what do I have to do?

Thank you

Format the cell as "m" (without the quotes)


--ron
 
P

Pedro Sendas Pereira

But I can't use the numeric value, and that is what I need...

I need to work with the month value ....
 
A

Alan

Pedro Sendas Pereira said:
But I can't use the numeric value, and that is what I need...

I need to work with the month value ....

Try this:

=MATCH(TEXT(A1,"MMM"),{"Jan","Feb",.....,"Dec"})

You can fill in the months for yourself, but it should give you 1 for
Jan, 4 for Apr, 10 for Oct etc.

HTH,

Alan.
 
A

Alan

Peo Sjoblom said:
Why not just?

=TEXT(A1,"mmm")

Bacause that will return "Oct" when he was asking for 10.

However, this is better still:

=VALUE(TEXT(A1,"MM"))

Alan.
 
P

Peo Sjoblom

I thought he didn't want 10?
If he wants a numeric 10 he should use month

=MONTH(A1)

If he wants a text 10

=TEXT(A1,"mm")

if he by some weird reason should want a numeric 10, BUT not using the month
function
then why not

=--TEXT(A1,"mm")

which is shorter than value
 
R

Ron Rosenfeld

But I can't use the numeric value, and that is what I need...

I need to work with the month value ....

Why can't you use the MONTH worksheet function? That would be simplest.

You could use:

=TEXT(A1,"m")

Even though it is a text function, for most math XL will convert it to a number
automagically.

If it must be a number, you can use:

=--TEXT(A1,"m")



--ron
 

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