Conditional Formatting - Multiple Conditions

kevin0226

New Member
Joined
Nov 25, 2019
Messages
7
Office Version
  1. 2016
Platform
  1. MacOS
Hi. I need to highlight column cells (rows 2 and on) that 1) are non-blank, 2) contain a number that is less than the number in that column's first row.
And then, how to spread that formatting to all columns of the spreadsheet?

5
3​
4​
4​
4​
3​
5​
3​
4​
7
4​
6​
6​
4​
3​
5​
3​
5​
6
3​
4​
5​
4​
3​
5​
4​
4​
6
4​
5​
3​
5​
2​
4​
5​
5​
4
2​
4​
4​
3​
3​
5​
5​
3​
6
4​
5​
5​
5​
3​
5​
4​
4​
6
3​
4​
4​
4​
3​
6​
2​
4​
5
3​
5​
3​
3​
3​
4​
3​
4​
5
4​
4​
5​
4​
3​
5​
4​
4​
4
3​
5​
5​
5​
2​
5​
5​
4​
5
4​
4​
5​
5​
3​
6​
2​
4​
6
3​
5​
5​
3​
3​
4​
3​
5​
Thanks!!!
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Try this:
1711128420690.png
 
Upvote 0
Solution
Selecting the range starting in cell B2 down to the last row and column with data.
Then go to Conditional Formatting and enter this Conditional Formatting formula in:
Excel Formula:
=AND($A2>0,B2>0,B2<$A2)
and choose your desired highlighting color.

The results should look something like this:
1711128441219.png
 
Upvote 0
That worked! Thank you so much! Bonus question: How to count the number of highlighted (colored) cells in each row?
Have a look at the COUNTIFS function. You should be able to use the same conditions that are being used in the CF formula.
 
Upvote 0
Can't get it to work. would you please write out the formula? I tried using this: =COUNTIF(A4<>"",A4<A$1), but no go. I am highlighting the cells with light green (excel code 4).

Thanks!
 
Upvote 0
Microsoft/Excel actually does a good job documenting all their functions. They contain detailed explanations and examples.
I could do it for you, but I would like you to take a try at it (I usually like to try to help people becomes "self-sufficient").
If you look at the very last example, it shows you how to do "less than" conditions using a value from a cell (almost exactly what you are trying to do).

Take a run at it, and see how you do!
If you get stuck again, post back with the formula you tried, and we will show you how to fix it up.
 
Upvote 0

Forum statistics

Threads
1,215,248
Messages
6,123,877
Members
449,130
Latest member
lolasmith

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top