[Solved] Multiple holidays on a calendar day

Discuss the spreadsheet application
Locked
Fitch
Posts: 118
Joined: Mon Feb 22, 2010 6:01 pm

[Solved] Multiple holidays on a calendar day

Post by Fitch »

Hi everybody.
I decided to make a perpetual calendar by plagiarising the best of other calendars.
I'm not an expert on Calc, but I managed with the forum help to get something reasonable. Thanks.
My last little problem is, that if there are two events on the same day, it only shows the first one.
e.g. in 2016, Burns Night and Bubblewrap Awareness Day both fall on the 25th January.
It only shows Burns Night in the January sheet.
I have (hopefully) attached the spreadsheet for everyone's perusal.
All the dates you want printed in the month sheets go into the right hand column in the workings sheet, and hey Presto!
Well, that was the idea, anyway.
I tried to ladle it with as many instructions so:
a) I can remember how to put in the dates
b) it can be put into a "Handy Spreadsheet" site for everyone else. Once I get that last bit right... Someone might also put me in the right direction for such a site.
calendar.ods
(97.65 KiB) Downloaded 194 times
Last edited by MrProgrammer on Sat Jan 11, 2025 4:19 am, edited 4 times in total.
Reason: Edited topic's subject
LibreOffice 5.1.4.2
Xenial Xerus
User avatar
RoryOF
Moderator
Posts: 35210
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How do I get another line?

Post by RoryOF »

Place cursor where you want the break, then Ctrl Enter
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
Fitch
Posts: 118
Joined: Mon Feb 22, 2010 6:01 pm

Re: How do I get another date to show on my calendar?

Post by Fitch »

Really?
LibreOffice 5.1.4.2
Xenial Xerus
ken johnson
Volunteer
Posts: 918
Joined: Sun May 31, 2009 1:35 am
Location: Sydney, Australia

Re: How do I get another date to show on my calendar?

Post by ken johnson »

Also, if you need the two events to be visible in the table in columns AI and AJ of the Workings sheet you could use merged cells as per attachment...

Ken Johnson
Attachments
calendar_example.ods
(88.66 KiB) Downloaded 185 times
AOO 4.1.3 on Ms Windows 10
Help improve this forum by clicking the EDIT button on your first post then adding "[Solved]" to its heading once a solution to your problem has been provided.
Fitch
Posts: 118
Joined: Mon Feb 22, 2010 6:01 pm

Re: How do I get another date to show on my calendar?

Post by Fitch »

Aah!
I see what you mean...

So now lets look at the year 2017:
Burns Night is on the 25th Jan as per normal.
Bubblewrap Awareness Day is on the 30th Jan.

In 2018, Bubblewrap Awareness Day is on the 29th Jan.
And what's more, Palm Sunday and British Summertime both fall on the 25th March.
Just as BST and Easter Sunday fell on the same day in 2016 (27th March).

I always knew the problem was in the "day" cells in each month.
e.g. =IF(ISNA(VLOOKUP(M8,Holidays,2,0)),"",VLOOKUP(M8,Holidays,2,0))
LibreOffice 5.1.4.2
Xenial Xerus
Fitch
Posts: 118
Joined: Mon Feb 22, 2010 6:01 pm

Re: How do I get another date to show on my calendar?

Post by Fitch »

Anyone?

I tried, e.g:

Code: Select all

=IF(ISNA(VLOOKUP(D12,Holidays,2,0)),"",VLOOKUP(D12,Holidays,2,0) &CHAR(10) & IF(VLOOKUP(D12,Holidays,2,1)<>VLOOKUP(D12,Holidays,2,0),VLOOKUP(D12,Holidays,2,1) ,""))
Now I get too many Global Belly Laugh days and the wrong day for Bubblewrap Awareness day as well as the correct holidays.

The days in the month of January have been altered with the above formula to see the problem.
calendar.ods
(98.56 KiB) Downloaded 183 times
LibreOffice 5.1.4.2
Xenial Xerus
ken johnson
Volunteer
Posts: 918
Joined: Sun May 31, 2009 1:35 am
Location: Sydney, Australia

Re: How do I get another date to show on my calendar?

Post by ken johnson »

Provided Holidays Database Range contains no more than two entries sharing the same date you can lookup the second entry by changing the height of vlookup's second parameter, array.
For example, 25/01/16's first entry, Burns Night, is on Holidays' 6th row. Hence VLOOKUP's array parameter for looking up 25/01/16's second entry, Bubble Wrap Awareness, should start on Holidays' 7th row,the next row down.
This reduced part of the Holidays Database Range is returned by the following formula...

Code: Select all

INDEX(Holidays;MATCH(C12;INDEX(Holidays;0;1);0)+1;1):INDEX(Holidays;ROWS(Holidays);2)
Note that it has two INDEX functions separated by a colon. When the INDEX function is used this way each INDEX function returns a reference to a range instead of its contents.

Code: Select all

INDEX(Holidays;MATCH(C12;INDEX(Holidays;0;1);0)+1;1)
returns a reference to the cell immediately below the first instance of 25/01/16.

Code: Select all

INDEX(Holidays;ROWS(Holidays);2)
returns a reference to Holidays' bottom-right cell.
Using this method in your formula results in...

Code: Select all

=IF(ISNA(VLOOKUP(C12;Holidays;2;0));"";VLOOKUP(C12;Holidays;2;0) &IF(ISNA(VLOOKUP(C12;INDEX(Holidays;MATCH(C12;INDEX(Holidays;0;1);0)+1;1):INDEX(Holidays;ROWS(Holidays);2);2;0));"";CHAR(10)&VLOOKUP(C12;INDEX(Holidays;MATCH(C12;INDEX(Holidays;0;1);0)+1;1):INDEX(Holidays;ROWS(Holidays);2);2;0)))
Ken Johnson
Attachments
calendarExample2.ods
(107.1 KiB) Downloaded 202 times
AOO 4.1.3 on Ms Windows 10
Help improve this forum by clicking the EDIT button on your first post then adding "[Solved]" to its heading once a solution to your problem has been provided.
Fitch
Posts: 118
Joined: Mon Feb 22, 2010 6:01 pm

Re: How do I get another date to show on my calendar?

Post by Fitch »

Well, that certainly seems to work.
I noticed you managed to do all 365 days.
That must've taken ages, or do you have a sneaky way?...
Thanks!
Is there a site I can put it for people to share?
LibreOffice 5.1.4.2
Xenial Xerus
ken johnson
Volunteer
Posts: 918
Joined: Sun May 31, 2009 1:35 am
Location: Sydney, Australia

Re: How do I get another date to show on my calendar?

Post by ken johnson »

Fitch wrote:I noticed you managed to do all 365 days.
That must've taken ages, or do you have a sneaky way?...
Nothing sneaky, just Copy then Paste Special/Formula.
Fitch wrote:Is there a site I can put it for people to share?
Any file sharing site could be used.
I mainly use MediaFire.

Ken Johnson
AOO 4.1.3 on Ms Windows 10
Help improve this forum by clicking the EDIT button on your first post then adding "[Solved]" to its heading once a solution to your problem has been provided.
gilhol
Posts: 1
Joined: Sat Jan 11, 2025 12:47 am

Re: how to expand Holiday Database Range

Post by gilhol »

How do I expand the Holidays Database Range. I have 145 relative's birthdays I want to add.
Hollie Gill, OpenOffice 4, Windows 11
User avatar
MrProgrammer
Moderator
Posts: 5430
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: [Solved] How do I get another date to show on my calendar?

Post by MrProgrammer »

gilhol wrote: Sat Jan 11, 2025 12:54 am How do I expand the Holidays Database Range.
Data → Define Range

If you have further questions, open your own topic. This one belongs to Fitch. You are more likely to get your problem solved quickly if you attach the spreadsheet file you're working with. Do not attach a picture of it.
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).
Locked