Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Finding month in mm/dd/yyyy format

Hello,
Given a column of dates in the mm/dd/yyyy format, how would I write a
function which would return only the month for each cell. I need the
month to be written out as numbers 1 through 12, or as Jan, Feb, etc.
Using the J, F, M, A, M month notation won't work because there are
too many duplicates.

Example: column 1 has dates, column 2 has daily temperatures, column 3
will contain all the temperatures for the month of January, column 4
for Feb, etc. So column three should have some function as follows:

=IF(column1 month = January, column2, "")

If someone knows how to do this, I'd appreciate it.

thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Finding month in mm/dd/yyyy format

There is a month funciton which takes a date as an argument and returns the
numbers 1 though 12 corresponding to the month...
--
HTH...

Jim Thomlinson


"Andrew" wrote:

Hello,
Given a column of dates in the mm/dd/yyyy format, how would I write a
function which would return only the month for each cell. I need the
month to be written out as numbers 1 through 12, or as Jan, Feb, etc.
Using the J, F, M, A, M month notation won't work because there are
too many duplicates.

Example: column 1 has dates, column 2 has daily temperatures, column 3
will contain all the temperatures for the month of January, column 4
for Feb, etc. So column three should have some function as follows:

=IF(column1 month = January, column2, "")

If someone knows how to do this, I'd appreciate it.

thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Finding month in mm/dd/yyyy format

Assuming A1 contains the date. If you want the month number...

=MONTH(A1)

If you want the abbreviated month name...

=TEXT(A1,"mmm")

If you want the full month name...

=TEXT(A1,"mmmm")

--
Rick (MVP - Excel)


"Andrew" wrote in message
...
Hello,
Given a column of dates in the mm/dd/yyyy format, how would I write a
function which would return only the month for each cell. I need the
month to be written out as numbers 1 through 12, or as Jan, Feb, etc.
Using the J, F, M, A, M month notation won't work because there are
too many duplicates.

Example: column 1 has dates, column 2 has daily temperatures, column 3
will contain all the temperatures for the month of January, column 4
for Feb, etc. So column three should have some function as follows:

=IF(column1 month = January, column2, "")

If someone knows how to do this, I'd appreciate it.

thanks


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,059
Default Finding month in mm/dd/yyyy format

"Andrew" wrote:
Given a column of dates in the mm/dd/yyyy format,
how would I write a function which would return
only the month for each cell. I need the month
to be written out as numbers 1 through 12


If A1 contains the date (in any format), MONTH(A1) returns the month number
between 1 and 12.


Example: column 1 has dates, column 2 has daily temperatures,
column 3 will contain all the temperatures for the month of
January, column 4 for Feb, etc.


If A1 contains the date and B1 contains the temperature, then put the
following formula into C1 and copy across through N1:

=IF(MONTH($A1)=COLUMN(C1)-COLUMN($B1),$B1,"")

Then copy the row down as needed. Be careful with the "$"; I purposely
wrote $A1, not $A$1, and I purposely wrote C1, not $C1.


----- original message -----

"Andrew" wrote in message
...
Hello,
Given a column of dates in the mm/dd/yyyy format, how would I write a
function which would return only the month for each cell. I need the
month to be written out as numbers 1 through 12, or as Jan, Feb, etc.
Using the J, F, M, A, M month notation won't work because there are
too many duplicates.

Example: column 1 has dates, column 2 has daily temperatures, column 3
will contain all the temperatures for the month of January, column 4
for Feb, etc. So column three should have some function as follows:

=IF(column1 month = January, column2, "")

If someone knows how to do this, I'd appreciate it.

thanks


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Finding month in mm/dd/yyyy format

You could put this in column C and copy down as far as needed.

IF(TEXT(A1, "mmmm") = "January", B1, "")


"Andrew" wrote in message
...
Hello,
Given a column of dates in the mm/dd/yyyy format, how would I write a
function which would return only the month for each cell. I need the
month to be written out as numbers 1 through 12, or as Jan, Feb, etc.
Using the J, F, M, A, M month notation won't work because there are
too many duplicates.

Example: column 1 has dates, column 2 has daily temperatures, column 3
will contain all the temperatures for the month of January, column 4
for Feb, etc. So column three should have some function as follows:

=IF(column1 month = January, column2, "")

If someone knows how to do this, I'd appreciate it.

thanks





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Finding month in mm/dd/yyyy format

On May 6, 9:16*am, "Rick Rothstein"
wrote:
Assuming A1 contains the date. If you want the month number...

=MONTH(A1)

If you want the abbreviated month name...

=TEXT(A1,"mmm")

If you want the full month name...

=TEXT(A1,"mmmm")

--
Rick (MVP - Excel)

"Andrew" wrote in message

...

Hello,
Given a column of dates in the mm/dd/yyyy format, how would I write a
function which would return only the month for each cell. *I need the
month to be written out as numbers 1 through 12, or as Jan, Feb, etc.
Using the J, F, M, A, M month notation won't work because there are
too many duplicates.


Example: column 1 has dates, column 2 has daily temperatures, column 3
will contain all the temperatures for the month of January, column 4
for Feb, etc. *So column three should have some function as follows:


=IF(column1 month = January, column2, "")


If someone knows how to do this, I'd appreciate it.


thanks


thanks for the help. The month() function worked perfectly.
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
Returning the month (mmm) from cell in date format dd/mm/yyyy Colin Hayes Excel Discussion (Misc queries) 3 February 5th 12 02:54 AM
How to show only Month of a mm/dd/yyyy format? yhoy Excel Discussion (Misc queries) 4 July 17th 08 01:18 AM
Converting Day, Date Month Year format to MM/DD/YYYY 61Petrus Excel Worksheet Functions 1 February 19th 08 08:47 PM
how do I change date from mm/dd/yyyy to dd:mm:yyyy format in Excel Jack Wilson New Users to Excel 4 July 18th 06 01:57 PM
opening excel file - date format problem: DD/MM/YYYY vs MM/DD/YYYY yung Excel Programming 2 March 18th 05 12:50 PM


All times are GMT +1. The time now is 08:44 PM.

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"