Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 94
Default convert date to name of month

My spreadsheet:

A B
Results: C
1/5/09 =IF(A1="","",MONTH(A1)) 1
?


In Column C, I need to write a formula that says =IF($B1=1,"January"...)
but my statement if FALSE, needs to be, IF($B1=2,"February" and so forth all
the way through the calendar. The false will be if a new IF formula.

I started with this,
=IF($B1=1,"January",IF($B1=2,"February",IF($B1=3," March")))

And all the way down the line to December, with the correct # of close
parens (12 of them) but I get an error. Do I need to keep typing in the "IF"
for a false statement? Help please :)
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default convert date to name of month

=if(a1="","",text(date(2009,a1,1),"mmmm"))

Is one way.



holly wrote:

My spreadsheet:

A B
Results: C
1/5/09 =IF(A1="","",MONTH(A1)) 1
?

In Column C, I need to write a formula that says =IF($B1=1,"January"...)
but my statement if FALSE, needs to be, IF($B1=2,"February" and so forth all
the way through the calendar. The false will be if a new IF formula.

I started with this,
=IF($B1=1,"January",IF($B1=2,"February",IF($B1=3," March")))

And all the way down the line to December, with the correct # of close
parens (12 of them) but I get an error. Do I need to keep typing in the "IF"
for a false statement? Help please :)


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 94
Default convert date to name of month

By the way, I tried the =TEXT($B1,"mmmm") in cell C1 and it returned January
when it should have returned February because I had the date of 2/9 in cell
A1, and a 2 in cell B1.

"holly" wrote:

My spreadsheet:

A B Results
1/5/09 =IF(A1="","",MONTH(A1)) 1



In Column C, I need to write a formula that says =IF($B1=1,"January"...)
but my statement if FALSE, needs to be, IF($B1=2,"February" and so forth all
the way through the calendar. The false will be if a new IF formula.

I started with this,
=IF($B1=1,"January",IF($B1=2,"February",IF($B1=3," March")))

And all the way down the line to December, with the correct # of close
parens (12 of them) but I get an error. Do I need to keep typing in the "IF"
for a false statement? Help please :)

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 846
Default convert date to name of month

If you simply have a 2 in cell b1 you will get January because Excel thinks
that the date is (January 2, 1900). To have the "mmmm" work you need to
have a valid date or make sure that your number is between 32 and 59
inclusive.
--
Wag more, bark less


"holly" wrote:

By the way, I tried the =TEXT($B1,"mmmm") in cell C1 and it returned January
when it should have returned February because I had the date of 2/9 in cell
A1, and a 2 in cell B1.

"holly" wrote:

My spreadsheet:

A B Results
1/5/09 =IF(A1="","",MONTH(A1)) 1



In Column C, I need to write a formula that says =IF($B1=1,"January"...)
but my statement if FALSE, needs to be, IF($B1=2,"February" and so forth all
the way through the calendar. The false will be if a new IF formula.

I started with this,
=IF($B1=1,"January",IF($B1=2,"February",IF($B1=3," March")))

And all the way down the line to December, with the correct # of close
parens (12 of them) but I get an error. Do I need to keep typing in the "IF"
for a false statement? Help please :)

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 94
Default convert date to name of month*Dave Peterson

THANK YOU!

"Dave Peterson" wrote:

=if(a1="","",text(date(2009,a1,1),"mmmm"))

Is one way.



holly wrote:

My spreadsheet:

A B
Results: C
1/5/09 =IF(A1="","",MONTH(A1)) 1
?

In Column C, I need to write a formula that says =IF($B1=1,"January"...)
but my statement if FALSE, needs to be, IF($B1=2,"February" and so forth all
the way through the calendar. The false will be if a new IF formula.

I started with this,
=IF($B1=1,"January",IF($B1=2,"February",IF($B1=3," March")))

And all the way down the line to December, with the correct # of close
parens (12 of them) but I get an error. Do I need to keep typing in the "IF"
for a false statement? Help please :)


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default convert date to name of month

Excel sees dates as numbers starting with a base date (January 1, 1900) as a
plain old number (1/1/1900 = 1) that is nicely formatted.

So when you look at 1, 2, 3, ...
it's like looking at:
1/1/1900, 1/2/1900, 1/3/1900, ...

And all of those belong to January of 1900.

So =text(a1,"mmmm") will return January for all these.



holly wrote:

By the way, I tried the =TEXT($B1,"mmmm") in cell C1 and it returned January
when it should have returned February because I had the date of 2/9 in cell
A1, and a 2 in cell B1.

"holly" wrote:

My spreadsheet:

A B Results
1/5/09 =IF(A1="","",MONTH(A1)) 1



In Column C, I need to write a formula that says =IF($B1=1,"January"...)
but my statement if FALSE, needs to be, IF($B1=2,"February" and so forth all
the way through the calendar. The false will be if a new IF formula.

I started with this,
=IF($B1=1,"January",IF($B1=2,"February",IF($B1=3," March")))

And all the way down the line to December, with the correct # of close
parens (12 of them) but I get an error. Do I need to keep typing in the "IF"
for a false statement? Help please :)


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default convert date to name of month

But you could get creative and use something like:

=if(a1="","",text(a1*28,"mmmm"))

All those values (1*28, 2*28, ..., 12*28) will refer to dates in 1900, but since
you're just looking at the month, it doesn't matter.

holly wrote:

By the way, I tried the =TEXT($B1,"mmmm") in cell C1 and it returned January
when it should have returned February because I had the date of 2/9 in cell
A1, and a 2 in cell B1.

"holly" wrote:

My spreadsheet:

A B Results
1/5/09 =IF(A1="","",MONTH(A1)) 1



In Column C, I need to write a formula that says =IF($B1=1,"January"...)
but my statement if FALSE, needs to be, IF($B1=2,"February" and so forth all
the way through the calendar. The false will be if a new IF formula.

I started with this,
=IF($B1=1,"January",IF($B1=2,"February",IF($B1=3," March")))

And all the way down the line to December, with the correct # of close
parens (12 of them) but I get an error. Do I need to keep typing in the "IF"
for a false statement? Help please :)


--

Dave Peterson
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
Formula convert date to month format Raine Excel Worksheet Functions 7 June 6th 09 07:25 AM
Convert date to number representing Month Karin Excel Discussion (Misc queries) 5 November 14th 08 06:09 AM
Convert date field to month in Pivot table MESTRELLA29 Excel Discussion (Misc queries) 9 May 23rd 07 02:50 PM
How do I convert a month-date format to day number of the year? Larry Excel Worksheet Functions 2 January 11th 07 05:21 PM
Date arithmetic: adding 1 month to prior end of month date manxman Excel Worksheet Functions 2 July 14th 06 09:29 PM


All times are GMT +1. The time now is 07:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"