[Solved] Data>Sort: Need it by month without regard to year

Discuss the spreadsheet application
Post Reply
HeidiD
Posts: 2
Joined: Tue Jun 27, 2017 8:16 pm

[Solved] Data>Sort: Need it by month without regard to year

Post by HeidiD »

Hello,
I have a set of data that I'd like to sort by Month, without regard to year. Office only seems to sort by year, ascending or descending, even though I've gone into the Options tab and checked Custom Sort Order and changed that to months. Is it possible to sort by month without regard to year?
Thanks
Attachments
test data set.ods
(13.45 KiB) Downloaded 139 times
Last edited by RoryOF on Tue Jun 27, 2017 11:09 pm, edited 3 times in total.
Open Office 4.1.2
Windows 10 Home
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Data->Sort-> Need it by month without regard to year

Post by Zizi64 »

Use a helper column with the function =Month(), then sort the range based on the helper column.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
HeidiD
Posts: 2
Joined: Tue Jun 27, 2017 8:16 pm

Re: Data->Sort-> Need it by month without regard to year

Post by HeidiD »

So you're telling me to go through all 50 lines of data, add a column, type the month from Column B into the new column and then sort?
Open Office 4.1.2
Windows 10 Home
User avatar
RoryOF
Moderator
Posts: 34612
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Data->Sort-> Need it by month without regard to year

Post by RoryOF »

In the first cell of the helper column enter =Month(Address of date column) or whatever the correct syntax is, select that cell, and pull down by the black dot in bottom right corner.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Data->Sort-> Need it by month without regard to year

Post by Zizi64 »

test data set2.ods
(14.58 KiB) Downloaded 122 times
The range was sorted based on the column D
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: "[SOLVED]" Data->Sort-> Need it by month without regard

Post by Villeroy »

Do you need the next birthday or something?
=DATE((DATE(YEAR(TODAY());MONTH(B1);DAY(B1))<TODAY())+YEAR(TODAY());MONTH(B1);DAY(B1))

the blue part compares this year's B1 date with today's date and returns 1 if it is smaller than today (this year's birthday is today or happened already) or 0 otherwise (this year's birthday is to come). This 0 or 1 is added to the year of this year's B1 date.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply