Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


At 22:10 13/09/2015 +0200, Dave Barton wrote:
In Calc I have column with a series of calculated dates (ie. the result of a formula). I am looking to find a way of using conditional formatting to set the background colour (eg. green) for those dates which fall on a Saturday or Sunday (eg. Condition: = WEEKDAY (A2; 2)>5 sets Format: Cell Background = Green)

Can anyone offer any pointers to a solution?

I think you have (almost?) answered your own question.

o Select *one* cell of your range - e.g. your A2.
o Go to Format | Conditional Formatting... .
o With "Condition 1" ticked, select "Formula is".
o In the Cell Value Condition box, enter: WEEKDAY(A2;2)>5
o For Cell Style, select Green. You need either already to have defined a "Green" cell style or else to create one on the fly using the New Style... button. o Now copy that formatting to other cells in your range. You can do this either by using the Format Paintbrush or by copying A2 and pasting it over the range, but using Paste Special... and selecting *just* Formats in the Paste Special dialogue.

Alternatively there is a quite different technique using the STYLE() function. Modify your original formulae to read:
=<your existing formula>+STYLE(IF(WEEKDAY(CURRENT();2)>5;"Green"))

I trust this helps.

Brian Barker


--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.