How do you sort the data by the month of the data?

S

Saz

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
 
S

squenson via OfficeKB.com

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.
 
P

Philip Reece-Heal

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[
 
G

gls858

Philip said:
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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top