Conditional formatting

Discuss the spreadsheet application
Post Reply
numaiu
Posts: 4
Joined: Sat Jun 23, 2018 3:36 pm

Conditional formatting

Post by numaiu »

Hello

I want to make a table in wich the color of an entire row should change depending on the value from the cells from the first column of the table.
I attached an example.
Can this be done?
Attachments
row color.ods
(10.26 KiB) Downloaded 74 times
Open Office 4, Windows 7 Ultimate
FJCC
Moderator
Posts: 9274
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Conditional formatting

Post by FJCC »

Select all of the cells you want to affect and go to the menu Format -> Conditional Formatting. In the Conditional Formatting dialog, set the leftmost box to Formula Is and make the formula like

Code: Select all

$B$6 = "Value 1"
All of the selected cells will then have formatting that depends on the value of B6. The $ in the cell reference make it absolute, so it does not change for each cell.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Conditional formatting

Post by Villeroy »

The "Formula" option is more useful than the comparison operators.
Attachments
row color2.ods
conditional formatting
(13.28 KiB) Downloaded 70 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
numaiu
Posts: 4
Joined: Sat Jun 23, 2018 3:36 pm

Re: Conditional formatting

Post by numaiu »

thank you for the tips but if new data will always be added/changed in the "value" column, is your solution still going to work?
Open Office 4, Windows 7 Ultimate
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Conditional formatting

Post by Villeroy »

did you try? Why not?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
numaiu
Posts: 4
Joined: Sat Jun 23, 2018 3:36 pm

Re: Conditional formatting

Post by numaiu »

Thanks Villeroy, but in your example i cannot introduce new values in the first column, so i found this example:

i made a helper column (A) with this forumla: =IF(B7=B6;A6;A6+1)

then, in conditional formatting i introduced 2 conditions:

ISEVEN($A31) - color 1
ISODD($A31) - color 2

this is solved
Attachments
row color 3.ods
(10.84 KiB) Downloaded 56 times
Open Office 4, Windows 7 Ultimate
Post Reply