Hi all.
I've been asked to sort members of our community shed (like a men's shed but with women as well) by their birthdays, so the closer it is to the big day, the further up the table they go. This means a free bacon roll in the café with a candle on top.
It sort of works - as with everything I try.
Sheet 1 (Membership) is where the members data is entered
Sheet 2 (Birthdays) is where I try to do some magic.
The member names are fictitious, but the dates (or lack of them) are real.
Columns I to N are the helper cells and columns A to E are the result.
For those who opt out of giving their birthdays (3) I make their birthday today minus 367. The results are good enough - they're always at the bottom.
I use MATCH to find which rows the fields are to go into. I did use SMALL, but the results are the same.
Nicholas Nickleby and Ray Sleeder both have their birthday on the 16th June. Nick Nickleby is shown on the results twice and Ray Sleeder not at all.
Not quite sure how to check for that.. (no idea how to)
Same with the three non birthdays. Eugene comes up three times whilst the ghostbuster and the happy Allota are missed.
Any chance there is a solution to this problem?
Thanks in advance.
[Solved] Sorted list using MATCH skips duplicates
[Solved] Sorted list using MATCH skips duplicates
Last edited by Hagar Delest on Thu Oct 31, 2024 8:59 am, edited 3 times in total.
Reason: tagged solved.
Reason: tagged solved.
LibreOffice 5.1.4.2
Xenial Xerus
Xenial Xerus
- MrProgrammer
- Moderator
- Posts: 5430
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: Using MATCH and not quite getting the required results
When there are duplicates, neither MATCH nor SMALL can be used to sort the birthdays with formulas.
Study [Tutorial] Sorting and Filtering data with formulas, especially the February 2014 post.
[Tutorial] Calc date formulas, section X
Age: =YEARS(birthdate;TODAY();0)
Days to next birthday: =EDATE(birthdate;age*12+12)-TODAY()
If this solved your problem please go to your first post use the Edit ✏️ button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: Using MATCH and not quite getting the required results
Confession:
I downloaded the tutorials a few years ago and then promptly forgot them.
Got myself in a mess now as date of birth and surname concatenated just results in a mess, and I have to subtract 69 from the sumproduct result
Columns P onwards on the Birthdays sheet is my utterly feeble attempt.
I downloaded the tutorials a few years ago and then promptly forgot them.
Got myself in a mess now as date of birth and surname concatenated just results in a mess, and I have to subtract 69 from the sumproduct result
Columns P onwards on the Birthdays sheet is my utterly feeble attempt.
LibreOffice 5.1.4.2
Xenial Xerus
Xenial Xerus
Re: Using MATCH and not quite getting the required results
Hallo
maybe upgrade to LO24.8:
maybe upgrade to LO24.8:
Libreoffice 25.2… on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (trixie) (on RaspberryPI5)
- MrProgrammer
- Moderator
- Posts: 5430
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: Using MATCH and not quite getting the required results
I created this with formulas straight from February 2014 tutorial attachment Sorting and Filtering data with formulas1.ods sheet MultiKey SubRank. For this to work the formulas must use $ correctly. Pay careful attention. The Ten Concepts tutorial explains $. This multi-key ranking method should work with any OpenOffice or LibreOffice version. It just needs SUMPRODUCT, MATCH, and INDEX, all of which have been available for 20 years.
If this solved your problem please go to your first post use the Edit ✏️ button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.
| Edit: The same basic method works in Numbers (Apple) or Excel (Microsnot), except that in those products SUMPRODUCT cannot be used with boolean expressions. But COUNTIFS can provide the same result. Example for H2: =SUMPRODUCT(B2>$B$2:$B$30;F2=$F$2:$F$30) becomes =COUNTIFS($B$2:$B$30;"<"&B2;$F$2:$F$30;F2). In this particular spreadsheet the YEARS function has to be replaced with DATEDIF. |
If this solved your problem please go to your first post use the Edit ✏️ button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: Using MATCH and not quite getting the required results
Thanks.
I managed to figure it out with your latest download.
Cheers!
I managed to figure it out with your latest download.
Cheers!
LibreOffice 5.1.4.2
Xenial Xerus
Xenial Xerus