Apply cell style through formula but leave contents alone?

I found this already which is nice, but it lacks two answers I’m looking for:

  1. Can STYLE be applied to a different cell than where the formula is in?
  2. If not, can a formula exist in a cell and still accept regular input?

My use case is this:

I have a sheet of weekdays calculated from an initial given date and I want to mark which are weekends, but not in the cells of the weekdays, but rather in a different cell where I want to be able to type just as if there was no formula there.

ask_114853.ods (11.4 KB)

1 Like
  1. No. And best forget about the STYLE() function, in most cases its use is ill-advised. See STYLE function.
  2. You can use conditional formatting, of which one of the options is to use a formula to determine which style to apply. See Applying Conditional Formatting and related topics.

Thank you for the information.

I don’t understand how to check if a different cell has WEEKDAY 6 or 7 using conditional formatting. Can it be done?

FIRST EDIT: Oh, I see… one does not have to use the pre-defined greater/lesser options, there is also a formula option… so, I need something like this:

WEEKDAY(DATE($Sheet1.$H$2;($Sheet1.$I$2*10)+$Sheet1.$J$2;$Sheet3.$B$2))>5

SECOND EDIT: There’s a problem with that formula apparently. How do I “debug” conditional formats, since they don’t show a preview of the result like in the regular formula editor…?

THIRD EDIT: No, pasting that formula line in an empty cell yields a TRUE result, yet the conditional formating doesn’t apply like it should. What could be the cause?

FOURTH EDIT: Oh, no… day 1 of WEEKDAY is Sunday. Why, oh why? That’s so silly. At least there’s a type parameter to add to change this to something more sensible.

As the definition in help for WEEKDAY says: For compatibility with Microsoft Excel.

For some, not since 1988.


But look up Sunday in an old (and not so old) dictionary.