[Solved] Building a Calendar in Calc from scratch

Discuss the spreadsheet application
Locked
mydadismyhero
Posts: 5
Joined: Mon Feb 29, 2016 6:42 am

[Solved] Building a Calendar in Calc from scratch

Post by mydadismyhero »

Hey guys, I need assistance in building a calendar from scratch using formulas. So far I've figured out how to use the Validity function to create a drop down menu and state the month (as a number, cant seem to figure out how to set January to =1, literally tried to figure this out for hours etc :crazy: :crazy: :crazy: ), and the Year. Then using the date formula i created the initial date of the month. How can I improve it from here? I'd like to have it automatically (using formulas of course) set holidays and etc.

Thanks.
Last edited by MrProgrammer on Tue Oct 20, 2020 5:29 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved]
OpenOffice 3.1 on Mac OS 10
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Building a Calendar in Calc from scratch

Post by RusselB »

Setting January to the first month is automatic in any of the date functions.
Out of curiosity, why are you trying to do a calendar when there are calendar templates already available?

I suggest looking at the various date functions in the help file, as I suspect you'll find a few of them handy.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
mydadismyhero
Posts: 5
Joined: Mon Feb 29, 2016 6:42 am

Re: Building a Calendar in Calc from scratch

Post by mydadismyhero »

Just needed some guidance on an assignment. I'd like to do well, my calendar works, its just that I'd like it to be better.

Also about the date function, I set it as =Date(A2,A1,1) referencing my drop down year and month menus. A1 is the month. If I use that it gives me a value error, but it you set A1 to 1 it works fine.

I've found the Easter fuction, which is nice. I can't figure out how to input weekdays into my basic calendar.
OpenOffice 3.1 on Mac OS 10
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Building a Calendar in Calc from scratch

Post by RusselB »

I actually meant looking in the Index of the Help file for date and time functions, not the DATE function alone.
I think you'll find the DATEVALUE function handy, as my experiments have shown good results
You may/will also need to work with the CONCATENATE and/or TEXT functions, inside the DATEVALUE function.

As to getting the dates under the correct Weekday names, the WEEKDAY function, I think, would be helpful
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
User avatar
MrProgrammer
Moderator
Posts: 5436
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Building a Calendar in Calc from scratch

Post by MrProgrammer »

Hi, and welcome to the forum.
mydadismyhero wrote:cant seem to figure out how to set January to =1
To convert "January" to 1, "February" to 2, etc. use [Tutorial] VLOOKUP questions and answers (or MATCH).
To convert the other way (1 → January, 2 → February, …) use either VLOOKUP or CHOOSE.
mydadismyhero wrote:its just that I'd like it to be better
Building a calendar is a great way to learn about Calc. But you might want to look at some of the calendar templates to get some ideas for how to improve what you've created. Or look at one I developed about ten years ago. I've learned quite a lot since then and perhaps wouldn't do it the same way now.
Cal.ods
(32.74 KiB) Downloaded 280 times
If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.

[Tutorial] Ten concepts that every Calc user should know
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).
Alex1
Volunteer
Posts: 852
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands, EU

Re: Building a Calendar in Calc from scratch

Post by Alex1 »

Here's another example. Cell B4 (invisible unless value higlighting is used) determines the first day of the week.
Attachments
Calendar.ods
(15.63 KiB) Downloaded 313 times
AOO 4.1.16 & LO 25.8.3 on Windows 10
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Building a Calendar in Calc from scratch

Post by acknak »

mydadismyhero wrote:... cant seem to figure out how to set January to =1, ...
If A1 contains a month name,

=MONTH(DATEVALUE(A1&" 1, 1900"))

will convert it to the proper month number: Jan=1, Feb=2, ...

This will only work if the locale accepts input dates in the form Jan 1, 1900 but since you're using English month names, this shouldn't be a problem.
AOO4/LO5 • Linux • Fedora 23
mydadismyhero
Posts: 5
Joined: Mon Feb 29, 2016 6:42 am

Re: Building a Calendar in Calc from scratch

Post by mydadismyhero »

Thanks everyone! Helped a tonne. I've gotten a lot further with the calendar using a combination of all this advice.

Currently trying to use get WEEKDAY to display the names of the week rather than numbers. I'm guessing the best way to do this is to use VLOOKUP.

Also, is there is a function that highlight a cell (or make it stand out) if the cell is a certain value (date, this is for holidays)? I'd like public holidays such as Christmas and etc. to stand out on the Calendar.

Once again, thanks for the help.
OpenOffice 3.1 on Mac OS 10
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Building a Calendar in Calc from scratch

Post by RusselB »

For the second part of your latest post, look at Conditional Formatting
I have something running through my head for the first part, but I'm drawing a blank as to the actual function name
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
Alex1
Volunteer
Posts: 852
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands, EU

Re: Building a Calendar in Calc from scratch

Post by Alex1 »

mydadismyhero wrote:Currently trying to use get WEEKDAY to display the names of the week rather than numbers. I'm guessing the best way to do this is to use VLOOKUP.
That's not necessary. Just format a date with format code NN or NNN to display the day of the week.
AOO 4.1.16 & LO 25.8.3 on Windows 10
Locked