How to get Month from abbreviated text to number

pilot

Active Member
Joined
Feb 17, 2002
Messages
345
Short of a lookup table, how can I get date functions to read 3 char text (JAN, FEB ...) as month number (1, 2...)?
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
On 2002-02-24 12:41, pilot wrote:
Short of a lookup table, how can I get date functions to read 3 char text (JAN, FEB ...) as month number (1, 2...)?

=MATCH(A1,{"jan";"feb";"mar";"apr";"may";"jun";"jul";"aug";"sep";"oct";"nov";"dec"},0)

will do.

I reckon the formula that you use in your cond format setup is why you're asking for this.

Did you know that, given a date, you can test whether that date is a date e.g., in "Jan" by using:

=TEXT(A1,"mmm")="Jan"

Aladin

PS. I have still a hard time to visualize the lay-out of your worksheet to which you want to apply cond format.
 
Upvote 0
On 2002-02-24 13:01, Aladin Akyurek wrote:
On 2002-02-24 12:41, pilot wrote:
Short of a lookup table, how can I get date functions to read 3 char text (JAN, FEB ...) as month number (1, 2...)?

=MATCH(A1,{"jan";"feb";"mar";"apr";"may";"jun";"jul";"aug";"sep";"oct";"nov";"dec"},0)

will do.

I reckon the formula that you use in your cond format setup is why you're asking for this.

Did you know that, given a date, you can test whether that date is a date e.g., in "Jan" by using:

=TEXT(A1,"mmm")="Jan"

Aladin

PS. I have still a hard time to visualize the lay-out of your worksheet to which you want to apply cond format.

I'd be glad to e-mail you a copy. And you are correct, ultimate goal is to black out all Sat, Sun & invalid dates.

Example: (each in separate cell)
1 2 3 .... 31
JAN
FEB
.
.
.
DEC

Intersection of FEB and 31 gives implied date of March 3.

This example didn't format very well here but picture months in Col A and days on Row above Jan beginning with Col B.
This message was edited by pilot on 2002-02-24 13:21
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,215
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top