ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   sort by month and date only (https://www.excelbanter.com/excel-discussion-misc-queries/130149-sort-month-date-only.html)

robnsd

sort by month and date only
 
Is there a way to sort by month and day only? For example, the field
"Date" is in a format mm/dd/yyyy but I want to sort it only by mm/dd
so that January 1, 2004 comes before October 10, 2003. Does that make
sense?

Robert

1/1
1/2....
2/1
2/2...
3/1
3/2...
etc.


Fred Smith

sort by month and date only
 
The way to do this is to set up a helper column with just the month and the day.
One formula is:

=date(year(today()),month(a1),day(a1)

Then sort on that column.

Another option is to restructure your data to have separate columns for the
year, month and day.

--
Regards,
Fred


"robnsd" wrote in message
oups.com...
Is there a way to sort by month and day only? For example, the field
"Date" is in a format mm/dd/yyyy but I want to sort it only by mm/dd
so that January 1, 2004 comes before October 10, 2003. Does that make
sense?

Robert

1/1
1/2....
2/1
2/2...
3/1
3/2...
etc.




daddylonglegs

sort by month and date only
 
I'd tweak that slightly, Fred

=DATE(0,MONTH(A1),DAY(A1))

otherwise 29th Feb will be equal to 1st March and might sort the wrong way
round....

or just use

=TEXT(A1,"mmdd")

"Fred Smith" wrote:

The way to do this is to set up a helper column with just the month and the day.
One formula is:

=date(year(today()),month(a1),day(a1)

Then sort on that column.

Another option is to restructure your data to have separate columns for the
year, month and day.

--
Regards,
Fred


"robnsd" wrote in message
oups.com...
Is there a way to sort by month and day only? For example, the field
"Date" is in a format mm/dd/yyyy but I want to sort it only by mm/dd
so that January 1, 2004 comes before October 10, 2003. Does that make
sense?

Robert

1/1
1/2....
2/1
2/2...
3/1
3/2...
etc.





Dave Peterson

sort by month and date only
 
One mo

=text(a1,"mmdd")

and sort by that column.

robnsd wrote:

Is there a way to sort by month and day only? For example, the field
"Date" is in a format mm/dd/yyyy but I want to sort it only by mm/dd
so that January 1, 2004 comes before October 10, 2003. Does that make
sense?

Robert

1/1
1/2....
2/1
2/2...
3/1
3/2...
etc.


--

Dave Peterson

robnsd

sort by month and date only
 
On Feb 10, 9:59 am, Dave Peterson wrote:
One mo

=text(a1,"mmdd")

and sort by that column.





robnsd wrote:

Is there a way to sort by month and day only? For example, the field
"Date" is in a format mm/dd/yyyy but I want to sort it only by mm/dd
so that January 1, 2004 comes before October 10, 2003. Does that make
sense?


Robert


1/1
1/2....
2/1
2/2...
3/1
3/2...
etc.


--

Dave Peterson- Hide quoted text -

- Show quoted text -


Thanks,

Works great.

Robert



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

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