[Solved] Conditional Formatting for an entire row

Discuss the spreadsheet application
Post Reply
Phantom5389
Posts: 2
Joined: Tue Aug 28, 2012 2:22 am

[Solved] Conditional Formatting for an entire row

Post by Phantom5389 »

Hi. Noob here, this is my first post.
I have done some reading on conditional formulas and I just can't seem to find the answer I am looking for or am I looking in the wrong place?
I have a spreadsheet setup (8 colums and numerous rows).
Most of the comments to be put into the cells is a 'Yes' or 'No'. What I am trying to setup is a formula or something that will colour automatically fill the entire row red/green whatever colour if any of the cells in that row has a 'No' in it.
Any help would be appreciated.

Thanks
Steve
Last edited by Phantom5389 on Thu Aug 30, 2012 3:14 am, edited 2 times in total.
OpenOffice 3.3.0
crusader
Volunteer
Posts: 537
Joined: Sun Jan 20, 2008 5:06 am

Re: Formulas for an entire row

Post by crusader »

For individual cells: Format -> Conditional Formatting.
You may need code if you want to color the entire row.
LibreOffice 26.2.x on Linux Mint Cinnamon 22.3
In a world without walls, who needs Window$
A candle loses nothing by lighting another candle
thinman3
Volunteer
Posts: 382
Joined: Sat Jul 11, 2009 8:53 pm

Re: Formulas for an entire row

Post by thinman3 »

I yield to Mr. Programmers' solution...original post deleted.

thinman3
Last edited by thinman3 on Tue Aug 28, 2012 4:58 pm, edited 2 times in total.
3.4.1 & 4.1.5 on MS Windows 7 Pro x64
User avatar
MrProgrammer
Moderator
Posts: 5473
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Conditional Formatting for an entire row

Post by MrProgrammer »

Hi, and welcome to the forum.
crusader wrote:You may need code if you want to color the entire row.
No code is needed. See attached example.

I typed A2:H28 in the name box of the formula bar, and used Format → Conditional Formatting → Formula Is → COUNTIF($A2:$H2;"No")>0 to give this condition a style with a cell background color. I'm done in one step.

Read section 8. Using formulas and cell references in Ten concepts that every Calc user should know if you don't know what the $'s in $A2:$H2 mean. Note that there is a $ before the column letters but no $ before the row numbers.

You could help other users of the forum if you go to your first post and change the title from "Formulas for an entire row" to "Conditional Formatting for an entire row", which I think will be easier to find for people with similar situations.

If this answered your question 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.
Attachments
201208280926.ods
(8.16 KiB) Downloaded 1787 times
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).
Phantom5389
Posts: 2
Joined: Tue Aug 28, 2012 2:22 am

Re: Conditional Formatting for an entire row

Post by Phantom5389 »

Thanks for that Mr. Programmer it has helped and works a treat.

I might see if I can add other formulas for other conditions in the same spreadsheet.

Reading through Ten Concepts, thanks again for your help.

Cheers
Steve
OpenOffice 3.3.0
carmelchas
Posts: 1
Joined: Tue Nov 06, 2012 2:58 am

Re: [Solved] Conditional Formatting for an entire row

Post by carmelchas »

I figured out a way to do what you would like. Below is my attempt to give you a step-by-step solution.

In this example, I wanted to use VLOOKUP to determine a relative value in order to determine the desired format relative to the row.

1. Highlight a range of cells in the first row in the desired range of cells.
2. In the main menu, click "Format".
3. In the sub-menu, click "Conditional Formatting".
4. In the "Condition 1" select "Formula is" instead of "Cell value is".
5. Enter the desired formula; In my case [ VLOOKUP($B3;Sheet2.$A$2:$C$890;3)="CONFLICT" ]
6. Select the desired style for the case where the condition evaluates to TRUE.
7. Click "OK"; This applies the formatting to the first row if the condition is true.
8. Highlight the same range of cells again.
9. Right-click on the selected range of cells.
10. Click "copy" in the context menu that appears.
11. Highlight the remaining row-cells.
12. Right-click on the selected range of cells.
13. Click "paste special" in the context menu that appears.
14. Uncheck the "Paste all" checkbox.
15. Make sure that the only "format" checkbox is checked.
16. Click "OK".

DONE.

Special Note: If you are using a formula, you will have to make sure to use ABSOLUTE cell references and RELATIVE cell references where applicable in order to ensure the formula maintains the relative-integrity desired with respect to the row.

Cell Referencing (just in-case):
=============================
$A$1 == Reference to the cell located in the Absolute column A in the Absolute Row 1
$A1 == Reference to the cell located in the Absolute column A in the Relative Row 1
A1 == Reference to the cell located in the Relative column A in the Relative Row 1
A$1 == Reference to the cell located in the Relative column A in the Absolute Row 1
Mac OSX OpenOffice.org version 3.4.1
Post Reply