Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 129
Default DATE() Month in Letter NOT Number

In Date(year,month,day) function, all need to be number, what if I have month
in letter, how can I use date function?

I've tried a different way by using if, nested function only allow 7 or 8 of
them, so I can't nest the function all the way to December.
If(A1=January,01,if(A1=February,02......and so on)

Anyone have any suggestions on how to do this?

Thanks,
GU
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default DATE() Month in Letter NOT Number

I will use three-letter abreviations. Say A1 contains:
jan
in another cell (say Z100):
=MATCH(A1,{"jan","feb","mar","apr","may","jun","ju l","aug","sep","oct","nov","dec"},0)

Instead of something like:

=DATE(2008,A1,17)
use
=DATE(2008,Z100,17)

--
Gary''s Student - gsnu200765


"Neon520" wrote:

In Date(year,month,day) function, all need to be number, what if I have month
in letter, how can I use date function?

I've tried a different way by using if, nested function only allow 7 or 8 of
them, so I can't nest the function all the way to December.
If(A1=January,01,if(A1=February,02......and so on)

Anyone have any suggestions on how to do this?

Thanks,
GU

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,091
Default DATE() Month in Letter NOT Number

If you have the month name like "March" in A1 and the numeric year in B1 and
the day of the month in C1 you could use:

=DATE(B1,MATCH(A1,{"January","February","March","A pril","May","June","July","August","September","Oc tober","November","December"},0),C1)

Tyro

"Neon520" wrote in message
...
In Date(year,month,day) function, all need to be number, what if I have
month
in letter, how can I use date function?

I've tried a different way by using if, nested function only allow 7 or 8
of
them, so I can't nest the function all the way to December.
If(A1=January,01,if(A1=February,02......and so on)

Anyone have any suggestions on how to do this?

Thanks,
GU



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default DATE() Month in Letter NOT Number

Maybe you can use something like:

=DATEVALUE(A1&" 1, 2008")
or
=DATEVALUE(A1 & " " & a2 & ", " & a3)
if a2 contains the date of the month and a3 contains the year.

Neon520 wrote:

In Date(year,month,day) function, all need to be number, what if I have month
in letter, how can I use date function?

I've tried a different way by using if, nested function only allow 7 or 8 of
them, so I can't nest the function all the way to December.
If(A1=January,01,if(A1=February,02......and so on)

Anyone have any suggestions on how to do this?

Thanks,
GU


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7,247
Default DATE() Month in Letter NOT Number

The following will return the date where the month name is in A1, the day of
month is in B1, and the year is in C1.

=TEXT(DATEVALUE(A1&" "&B1&", "&C1),"mmm dd, yyyy")

The value in A1 can be either the 3-character month abbreviation (Jan, Feb,
etc) or the full month name (January, February, etc).


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


"Neon520" wrote in message
...
In Date(year,month,day) function, all need to be number, what if I have
month
in letter, how can I use date function?

I've tried a different way by using if, nested function only allow 7 or 8
of
them, so I can't nest the function all the way to December.
If(A1=January,01,if(A1=February,02......and so on)

Anyone have any suggestions on how to do this?

Thanks,
GU




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,942
Default DATE() Month in Letter NOT Number

hi
I think you need to look at how you have the cell formated.
if your have format set to "March 14,2001" then the formula produces
=date(2007,1,14) = January 14,2008
If you have format set to "03/14/01" then the formula produces
=date(2007,1,14) = 01/14/08

is that what you are trying to do? have a date with all numbers?

works in xp 2003.
regards
FSt1


is this what your are trying to do.

"Neon520" wrote:

In Date(year,month,day) function, all need to be number, what if I have month
in letter, how can I use date function?

I've tried a different way by using if, nested function only allow 7 or 8 of
them, so I can't nest the function all the way to December.
If(A1=January,01,if(A1=February,02......and so on)

Anyone have any suggestions on how to do this?

Thanks,
GU

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default DATE() Month in Letter NOT Number

ps. Remember to format the cell with the formula with a nice date format.

Dave Peterson wrote:

Maybe you can use something like:

=DATEVALUE(A1&" 1, 2008")
or
=DATEVALUE(A1 & " " & a2 & ", " & a3)
if a2 contains the date of the month and a3 contains the year.

Neon520 wrote:

In Date(year,month,day) function, all need to be number, what if I have month
in letter, how can I use date function?

I've tried a different way by using if, nested function only allow 7 or 8 of
them, so I can't nest the function all the way to December.
If(A1=January,01,if(A1=February,02......and so on)

Anyone have any suggestions on how to do this?

Thanks,
GU


--

Dave Peterson


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default DATE() Month in Letter NOT Number

Another possibility...

=DATE(A3,MONTH(A1&"-"&A3),A2)

where A1 contains your month in numbers, A2 the day and A3 the year.

Rick


"Neon520" wrote in message
...
In Date(year,month,day) function, all need to be number, what if I have
month
in letter, how can I use date function?

I've tried a different way by using if, nested function only allow 7 or 8
of
them, so I can't nest the function all the way to December.
If(A1=January,01,if(A1=February,02......and so on)

Anyone have any suggestions on how to do this?

Thanks,
GU


  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default DATE() Month in Letter NOT Number

Another possibility...

=DATE(A3,MONTH(A1&"-"&A3),A2)

where A1 contains your month in numbers, A2 the day and A3 the year.


LOL ... where A1 contains your month in LETTERS...

Rick
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default DATE() Month in Letter NOT Number

On Mon, 14 Jan 2008 15:25:02 -0800, Neon520
wrote:

In Date(year,month,day) function, all need to be number, what if I have month
in letter, how can I use date function?

I've tried a different way by using if, nested function only allow 7 or 8 of
them, so I can't nest the function all the way to December.
If(A1=January,01,if(A1=February,02......and so on)

Anyone have any suggestions on how to do this?

Thanks,
GU


To return the Month number of the spelled out Month in A1, you could use this
formula:

=MATCH(A1,{"January";"February";"March";"April";"M ay";"June";"July";"August";"September";"October";" November";"December"},0)

or possibly:

=MATCH(LEFT(A1,3),{"Jan";"Feb";"Mar";"Apr";"May";" Jun";"Jul";"Aug";"Sep";"Oct";"Nov";"Dec"},0)

Depending on your data, however, you may be able to convert directly to a Date.

For example, if your month is in A1 (spelled out), day of the month in A2 and
year in A3

=--(A2&" "&A1&" "&A3)

or

=--(A1&" "&A2&", "&A3)

will return an Excel date. Just format the result as a date.
--ron


  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default DATE() Month in Letter NOT Number

=DATEVALUE(A1 & " " & a2 & ", " & a3)

It looks like you can shorten the above to this...

=DATEVALUE(A2&A1&A3)

Rick
  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default DATE() Month in Letter NOT Number

The following will return the date where the month name is in A1, the day
of month is in B1, and the year is in C1.

=TEXT(DATEVALUE(A1&" "&B1&", "&C1),"mmm dd, yyyy")

The value in A1 can be either the 3-character month abbreviation (Jan,
Feb, etc) or the full month name (January, February, etc).


I just posted this (using different cell references) to Dave's posting....

=DATEVALUE(B1&A1&C1)

Rick

  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default DATE() Month in Letter NOT Number

=--(A2&" "&A1&" "&A3)

or

=--(A1&" "&A2&", "&A3)

will return an Excel date. Just format the result as a date.


Interesting... you can shorten that to this...

=--(A2&A1&A3)

provided A1 contains the month name.

Rick
  #14   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default DATE() Month in Letter NOT Number

And using Ron's formula as a base, this can be shorted to...

=--(A2&A1&A3)

Rick


"Rick Rothstein (MVP - VB)" wrote in
message ...
=DATEVALUE(A1 & " " & a2 & ", " & a3)


It looks like you can shorten the above to this...

=DATEVALUE(A2&A1&A3)

Rick


  #15   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default DATE() Month in Letter NOT Number

And using Ron's formula as a base, this can be shorted to...

=--(A2&A1&A3)

Rick


"Rick Rothstein (MVP - VB)" wrote in
message ...
The following will return the date where the month name is in A1, the day
of month is in B1, and the year is in C1.

=TEXT(DATEVALUE(A1&" "&B1&", "&C1),"mmm dd, yyyy")

The value in A1 can be either the 3-character month abbreviation (Jan,
Feb, etc) or the full month name (January, February, etc).


I just posted this (using different cell references) to Dave's posting....

=DATEVALUE(B1&A1&C1)

Rick




  #16   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default DATE() Month in Letter NOT Number

On Mon, 14 Jan 2008 20:09:48 -0500, "Rick Rothstein \(MVP - VB\)"
wrote:

=--(A2&" "&A1&" "&A3)

or

=--(A1&" "&A2&", "&A3)

will return an Excel date. Just format the result as a date.


Interesting... you can shorten that to this...

=--(A2&A1&A3)

provided A1 contains the month name.

Rick


That is interesting. I never realized that NO separators could be used,
especially when some separators will give an error

e.g. "12.dec.12"


--ron
  #17   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,091
Default DATE() Month in Letter NOT Number

If this is not a "documented" feature in Excel as a valid way of doing
things, then prepare for MS to suddenly drop it. Using undocumented results
can be very dangerous.

Tyro

"Ron Rosenfeld" wrote in message
...
On Mon, 14 Jan 2008 20:09:48 -0500, "Rick Rothstein \(MVP - VB\)"
wrote:

=--(A2&" "&A1&" "&A3)

or

=--(A1&" "&A2&", "&A3)

will return an Excel date. Just format the result as a date.


Interesting... you can shorten that to this...

=--(A2&A1&A3)

provided A1 contains the month name.

Rick


That is interesting. I never realized that NO separators could be used,
especially when some separators will give an error

e.g. "12.dec.12"


--ron



  #18   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default DATE() Month in Letter NOT Number

On Mon, 14 Jan 2008 18:22:59 -0800, "Tyro" wrote:

If this is not a "documented" feature in Excel as a valid way of doing
things, then prepare for MS to suddenly drop it. Using undocumented results
can be very dangerous.

Tyro


You probably should avoid the DATEDIF worksheet function then, except in
XL2000. If you do suggest its use, you should be very careful to point out its
flaws.
--ron
  #19   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,091
Default DATE() Month in Letter NOT Number

Indeed. Anything that is undocumented, is subject to change, removal etc. MS
has no obligation to support such things.

Tyro

"Ron Rosenfeld" wrote in message
...
On Mon, 14 Jan 2008 18:22:59 -0800, "Tyro" wrote:

If this is not a "documented" feature in Excel as a valid way of doing
things, then prepare for MS to suddenly drop it. Using undocumented
results
can be very dangerous.

Tyro


You probably should avoid the DATEDIF worksheet function then, except in
XL2000. If you do suggest its use, you should be very careful to point
out its
flaws.
--ron



  #20   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default DATE() Month in Letter NOT Number

I think that the only obligation any software company is to itself (and
stockholders).

Will they do stupid things that cause them to lose market share--probably not.

Will they do things that users don't like, undoubtedly.

I wouldn't hesitate using Ron's formula -- if I could remember it <bg.

Tyro wrote:

Indeed. Anything that is undocumented, is subject to change, removal etc. MS
has no obligation to support such things.

Tyro

"Ron Rosenfeld" wrote in message
...
On Mon, 14 Jan 2008 18:22:59 -0800, "Tyro" wrote:

If this is not a "documented" feature in Excel as a valid way of doing
things, then prepare for MS to suddenly drop it. Using undocumented
results
can be very dangerous.

Tyro


You probably should avoid the DATEDIF worksheet function then, except in
XL2000. If you do suggest its use, you should be very careful to point
out its
flaws.
--ron


--

Dave Peterson


  #21   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default DATE() Month in Letter NOT Number

Each to his own, then.

I noted you did not caution about the DATEDIF inconsistencies in a previous
thread, nor mention concern about it's use when it is not documented; so I
guess there are only certain undocumented features that concern you.

I'd have a lot more concern about using MOD with certain classes of numbers
(also undocumented), or using DATEDIF, than I would about date_text
conversions.
--ron



On Mon, 14 Jan 2008 18:53:16 -0800, "Tyro" wrote:

Indeed. Anything that is undocumented, is subject to change, removal etc. MS
has no obligation to support such things.

Tyro

"Ron Rosenfeld" wrote in message
.. .
On Mon, 14 Jan 2008 18:22:59 -0800, "Tyro" wrote:

If this is not a "documented" feature in Excel as a valid way of doing
things, then prepare for MS to suddenly drop it. Using undocumented
results
can be very dangerous.

Tyro


You probably should avoid the DATEDIF worksheet function then, except in
XL2000. If you do suggest its use, you should be very careful to point
out its
flaws.
--ron



--ron
  #22   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default DATE() Month in Letter NOT Number

=--(A2&" "&A1&" "&A3)

or

=--(A1&" "&A2&", "&A3)

will return an Excel date. Just format the result as a date.


Interesting... you can shorten that to this...

=--(A2&A1&A3)

provided A1 contains the month name.

Rick


That is interesting. I never realized that NO separators could be used,


I'm not sure why, but when I saw Dave's DATEVALUE formula, it reminded me of
the date format that was used on my orders from my days in the Air Force...
I always thought 15Jan08 was a nice format for some reason (although it
"looked" better when the year wasn't decipherable as a day value; e.g.,
15Jan67), so it occurred to me to try it in the DATEVALUE function... and it
worked. Then I saw your --(<datestring) format and figured I would try it
there too... and, again, it worked.

Rick

  #23   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default DATE() Month in Letter NOT Number

On Tue, 15 Jan 2008 12:53:55 -0500, "Rick Rothstein \(MVP - VB\)"
wrote:

I'm not sure why, but when I saw Dave's DATEVALUE formula, it reminded me of
the date format that was used on my orders from my days in the Air Force...
I always thought 15Jan08 was a nice format for some reason (although it
"looked" better when the year wasn't decipherable as a day value; e.g.,
15Jan67), so it occurred to me to try it in the DATEVALUE function... and it
worked. Then I saw your --(<datestring) format and figured I would try it
there too... and, again, it worked.

Rick


I remember that format, now that you mention it. And I, too, was dealing with
years that could not be mistaken for day (or month) values <g.
--ron
  #24   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default DATE() Month in Letter NOT Number

my days in the Air Force...

Me too!

SAC - Kincheloe MI, Castle CA

--
Biff
Microsoft Excel MVP


"Rick Rothstein (MVP - VB)" wrote in
message ...
=--(A2&" "&A1&" "&A3)

or

=--(A1&" "&A2&", "&A3)

will return an Excel date. Just format the result as a date.

Interesting... you can shorten that to this...

=--(A2&A1&A3)

provided A1 contains the month name.

Rick


That is interesting. I never realized that NO separators could be used,


I'm not sure why, but when I saw Dave's DATEVALUE formula, it reminded me
of the date format that was used on my orders from my days in the Air
Force... I always thought 15Jan08 was a nice format for some reason
(although it "looked" better when the year wasn't decipherable as a day
value; e.g., 15Jan67), so it occurred to me to try it in the DATEVALUE
function... and it worked. Then I saw your --(<datestring) format and
figured I would try it there too... and, again, it worked.

Rick



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
Convert date to number representing Month Karin Excel Discussion (Misc queries) 5 November 14th 08 06:09 AM
Adding a number to a letter of the alphabet to get a letter [email protected] Excel Worksheet Functions 5 May 21st 07 04:25 PM
change headers from letter to number/number to letter lazybee Excel Worksheet Functions 1 July 29th 05 11:08 PM
column header changed from letter to number, how return to letter Ron Excel Discussion (Misc queries) 2 May 9th 05 08:34 PM
Returning the Week Number of a Specific Date on a Month arjcvg Excel Worksheet Functions 0 November 5th 04 01:21 AM


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