ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   How do you sort the data by the month of the data? (https://www.excelbanter.com/new-users-excel/154274-how-do-you-sort-data-month-data.html)

Saz

How do you sort the data by the month of the data?
 
Hi, The file has date formate as MM/DD/YYYY and I want to keep it that
way. Is there anyway the file can be sorted by only MM? I am trying to
sort by Jan, Feb, March...... November, December together.

Thanks,
Saz


squenson via OfficeKB.com

How do you sort the data by the month of the data?
 
You should create a new column, let's say G, with the formula G2: =MONTH(A2),
where A is the column containing the date. Then you can sort according to
this column. But if you have dates for more than one year, all the entries
for January 2006 and January 2007 will be sorted together. Use instead
G2=YEAR(A2)*100+MONTH(A2) to avoid this situation.

Stephane.

--
Message posted via http://www.officekb.com


Philip Reece-Heal

How do you sort the data by the month of the data?
 
Assuming the date in your sheet is numerical and not text, then a possible
solution is to create a column next to your date column (and assuming your
date column is A) in the new column enter the formula =MONTH(A1) which will
give you the month (numbered 1 to 12). Copy formula down the rows you want
and sort on that column.

You could then hide the new column or delete it altogether.

Hope that is of help

Philip[


"Saz" wrote in message
ps.com...
Hi, The file has date formate as MM/DD/YYYY and I want to keep it that
way. Is there anyway the file can be sorted by only MM? I am trying to
sort by Jan, Feb, March...... November, December together.

Thanks,
Saz



gls858

How do you sort the data by the month of the data?
 
Philip Reece-Heal wrote:
Assuming the date in your sheet is numerical and not text, then a
possible solution is to create a column next to your date column (and
assuming your date column is A) in the new column enter the formula
=MONTH(A1) which will give you the month (numbered 1 to 12). Copy
formula down the rows you want and sort on that column.

You could then hide the new column or delete it altogether.

Hope that is of help

Philip[


"Saz" wrote in message
ps.com...
Hi, The file has date formate as MM/DD/YYYY and I want to keep it that
way. Is there anyway the file can be sorted by only MM? I am trying to
sort by Jan, Feb, March...... November, December together.

Thanks,
Saz



Not very elegant, but when I need to do this I just break the date into
3 columns month,day,year by using text to columns and format it as text.

gls858


All times are GMT +1. The time now is 11:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com