Conditional formatting check multiple cell values?

Discuss the spreadsheet application
Post Reply
arminius
Posts: 1
Joined: Sun Sep 10, 2017 8:58 am

Conditional formatting check multiple cell values?

Post by arminius »

I wasn't sure how to articulate my question in the amount of characters allowed in the headline.

I'll do my best here.

So I have set up a number of cells where the numbers listed determine their background & font colors.

So cell B47 has Condition 1, Formula is $I $41 < 500 which sets a background of red.
Condition 2, Formua is $I $41 < 1500 which sets a background of yellow.
Condition 3, Formula is $I $41 < 3000 which sets a background of green.

The end result is so if a number is higher than 3000 the background is Blue and I know not to worry ab2it, if it's red I know I need to immediately restock the item in question.

What I'm wanting to do is have a cell that examines the values of multiple cells and sets its cell style to the lowest one, so it can let me know if an entire category of cells are blue and fine or if there's just one red then I know instantly.

Suppose B47 & D47 are blue but C47 is red then I need A47 to be red.
But if B47 & C47 are blue but D47 is Green then A47 needs to be green.

Hope I made that understandable and what I'm asking isn't impossible.
Apache Open office 4.2.3
Windows 7
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Conditional formatting check multiple cell values?

Post by Zizi64 »

You can not get the styles (name or other property) applied by the conditional format function. You can not get them with any formula or any macro.

But you can combine the original conditions by usage of the AND OR boolean operators (functions).
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
FJCC
Moderator
Posts: 9274
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Conditional formatting check multiple cell values?

Post by FJCC »

If I follow your correctly, you can use a conditional format formula like

Code: Select all

MIN(B47:D47) < 500
in A47 to set the for mat to red if any cell in B47:D47 is below 500.
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
keme
Volunteer
Posts: 3704
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Conditional formatting check multiple cell values?

Post by keme »

What FJCC said...

Also, if alert levels/restock conditions vary between items, you can use a helper row, setting it to e.g. ...
1 for Restock (red)
2 for Low (yellow)
3 for Used (green)
4 for Full (blue)

This also works with the MIN() condition suggested above.
This additional step also enables the style names Alert1 ... Alert4 to be used with the STYLE() function, which may be useful in some situations.
Apache OO 4.1.12 and LibreOffice 7.5, mostly on Ms Windows 10
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Conditional formatting check multiple cell values?

Post by Zizi64 »

Note:

The 'Conditional Formatting' function of the AOO can handle three conditions only. Use the function STYLE() if you want to more conditions (as Keme suggested), or install the LibreOffice. The LO can handle more than 3 conditions in the CF function.


And please upload your ODF type sample file here with some dummy data, and some comments.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Post Reply