You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Conditional highlighting

I made a calendar from scratch and I was curious as to how I can use conditional highlighting to grey out the font of the days that are not included in the selected month. Keep in mind all data is coming from 1 table. The month is in a list above the calendar portion and i would like for the days not included in the month (even when i change months in the list)to be formatted differently, making it easier to identify the current month selected.

MacBook Pro 14″, macOS 14.6

Posted on Sep 4, 2024 1:28 PM

Reply
2 replies

Sep 4, 2024 2:38 PM in response to cbiffy

There are many approaches to this. The specifics, though, will depend on your format.


It isn't possible to discern from your post what your spreadsheet looks like, specifically if you're using date or numeric fields.


Assuming, though, you have some field that includes the month name in cell A1, you can extract the last day of that month using the formula:


=DAY(EOMONTH($A$1,0))


where EOMONTH() is a function that calculates the last day of the month, and DAY() returns the day component.


If you want, you can hide this cell so that you don't see the number, if that bothers you.


Now you have a cell that calculates how many days this month should have, and can be used as the conditional field in your conditional highlighting. For example, if the DAY(EOMONTH()) function is in B2, set your conditional highlighting to:



Now any time the cell value exceeds the number of days in the month, the color will change accordingly.

Sep 4, 2024 4:39 PM in response to cbiffy

I recommend poking around in the 'Calendar' template (at File > New) to see how it does this. Here I've unhidden the rows in the 'Month and Year' table so you can see some of the inner workings.




It's well worth exploring other parts of the template. It's full of tricks, for example in the little previous and next months upper right, where it uses Conditional Highlighting not just to fade, but to hide completely, days that are not in the relevant months.


SG

Conditional highlighting

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.