Conditional Formatting "Less Than" formula on multiple cells ignoring "0" value

Brendon Donald

New Member
Joined
Apr 27, 2022
Messages
10
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I am looking for a conditional formatting formula which compares one cell value (CB51) against 6 other cells values (CB30, CB31, CB41, CB43, CB66 and CB69) to determine whether it is less than any of the 6 cells values and turns green but also ignores if any of the 6 cells values that are 0?

This is what I have and it doesn't work????
=AND(ISBLANK($CB$41)=FALSE,ISBLANK($CB$43)=FALSE,ISBLANK($CB$66)=FALSE,ISBLANK($CB$69)=FALSE,$CB$51<$CB$30,$CB$51<$CB$31,$CB$51<$CB$41,$CB$51<$CB$43,$CB$51<$CB$66,$CB$51<$CB$69)

Thanks,
 
In what way doesn't it work?

Can you post some sample data, along with expected result.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
In what way doesn't it work?

Can you post some sample data, along with expected result.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
Hi Fluff, I followed the instructions, so hopefully you can paste the below into your spreadsheet, I also added some note to my spreadsheet before copying trying to explain what I want my spreadsheet to do.

Book1
AOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJBKBLBMBNBOBPBQBRBSBTBUBVBWBXBYBZCACB
30These cells to change to green if CB30 is between CB51 & CB53, if not then turn red6m100yds60.016.0100
31These cells to change to green if CB30 is between CB51 & CB53, if not then turn red9m1500yds90.159.1500
32
33
34
35
36
37
38
39
40
41These cells to change to green if CB41 is between CB51 & CB53, if lower or higher than CB51 or CB53 turn red, or stay blank if no value is entered5myds505.0000
42
43These cells to change to green if CB43 is between CB51 & CB53, if lower or higher than CB51 or CB53 turn red, or stay blank if no value is entered5myds505.0000
44
45
46
47
48
49
50
51These cells to change green if CB51 has the lowest value or turn red if its greater than any of the values in CB30, CB31, CB41(if contains a value), CB43(if contains a value), CB66(if contains a value), CB69(if contains a value), 1myds101.0000
52
53These cells to change green if CB53 has the greatest value or turn red if its lower than any of the values in CB30, CB31, CB41(if contains a value), CB43(if contains a value), CB66(if contains a value), CB69(if contains a value), 10myds10010.0000
54
55
56
57
58
59
60
61
62
63
64
65
66These cells to change to green if CB66 is between CB51 & CB53, if lower or higher than CB51 or CB53 turn red, or stay blank if no value is enteredmyds000.0000
67
68
69These cells to change to green if CB69 is between CB51 & CB53, if lower or higher than CB51 or CB53 turn red, or stay blank if no value is entered4myds404.0000
Sheet1
Cell Formulas
RangeFormula
BZ69,BZ66,BZ53,BZ51,BZ43,BZ41,BZ30:BZ31BZ30=AR30
CA69,CA66,CA53,CA51,CA43,CA41,CA30:CA31CA30=AU30/10000
CB69,CB66,CB53,CB51,CB43,CB41,CB30:CB31CB30=BZ30+CA30
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AR53,AU53Expression=AND($CB$53>$CB$30,$CB$53>$CB$31,$CB$53>$CB$41,$CB$53>$CB$43,$CB$53>$CB$66,$CB$53>$CB$69)textNO
AR51,AU51Expression=AND($CB$41<>0,$CB$43<>0,$CB$66<>0,$CB$69<>0,$CB$51<$CB$30,$CB$51<$CB$31,$CB$51<$CB$41,$CB$51<$CB$43,$CB$51<$CB$66,$CB$51<$CB$69)textNO
AR31,AU31Expression=AND($CB$31>$CB$51,$CB$31<$CB$53)textNO
AU69Expression=AND($CA$69>$CA$51,$CA$69<$CA$53)textNO
AR69,AU69Expression=AND($CB$69>$CB$51,$CB$69<$CB$53)textNO
AU66Expression=AND($CA$66>$CA$51,$CA$66<$CA$53)textNO
AR66,AU66Expression=AND($CB$66>$CB$51,$CB$66<$CB$53)textNO
AR30,AU30Expression=AND($CB$30>$CB$51,$CB$30<$CB$53)textNO
AR53,AU53Expression=AND(ISBLANK($CB$69)=FALSE, $CB$69>$CB$53, $CB$53>0.0001)textNO
AR53,AU53Expression=AND(ISBLANK($CB$66)=FALSE, $CB$66>$CB$53, $CA$53>0.0001)textNO
AR53,AU53Expression=AND($CB$43>$CB$53, $CB$53>0.0001)textNO
AR53,AU53Expression=AND($CB$41>$CB$53, $CB$53>0.0001)textNO
AR53,AU53Expression=AND($CB$31>$CB$53, $CB$53>0.0001)textNO
AR53,AU53Expression=AND($CB$30>$CB$53, $CB$53>0.0001)textNO
AR51,AU51Expression=AND(ISBLANK($CB$69)=FALSE, $CB$69<$CB$51,$CB$69>0)textNO
AR51,AU51Expression=AND(ISBLANK($CB$66)=FALSE, $CB$66<$CB$51,$CB$66>0)textNO
AR51,AU51Expression=AND(ISBLANK($CB$43)=FALSE, $CB$43<$CB$51,$CB$43>0)textNO
AR51,AU51Expression=AND(ISBLANK($CB$41)=FALSE, $CB$41<$CB$51,$CB$41>0)textNO
AR51,AU51Expression=AND($CB$31<$CB$51)textNO
AR51,AU51Expression=AND($CB$30<$CB$51)textNO
AR43,AU43Expression=AND($CB$43>$CB$51,$CB$43<$CB$53)textNO
AR41,AU41Expression=AND($CB$41>$CB$51,$CB$41<$CB$53)textNO
Cells with Data Validation
CellAllowCriteria
BA30:BB30List='[PK - TRACK ACCESS-SWP REQUEST FORM.xlsx.xlsm]A1 Do Not Use'!#REF!
BC32:BW32List='[PK - TRACK ACCESS-SWP REQUEST FORM.xlsx.xlsm]A1 Do Not Use'!#REF!
BC33:BW34List='[PK - TRACK ACCESS-SWP REQUEST FORM.xlsx.xlsm]A1 Do Not Use'!#REF!
AO40:AP40List='[PK - TRACK ACCESS-SWP REQUEST FORM.xlsx.xlsm]A1 Do Not Use'!#REF!
AU40:AW40List='[PK - TRACK ACCESS-SWP REQUEST FORM.xlsx.xlsm]A1 Do Not Use'!#REF!
BC69List='C:\Users\BDonald\Desktop\AMOC WPP\[Site Inspection Report - BD Copy rev4.xlsm]Do not use'!#REF!
AY51:BB67List='C:\My Documents\AMOC WPP\[Track access. SWP request form.xlsm]A2 Team Info'!#REF!
BC51:BW67List='[PK - TRACK ACCESS-SWP REQUEST FORM.xlsx.xlsm]A1 Do Not Use'!#REF!
BC38:BW38List='[PK - TRACK ACCESS-SWP REQUEST FORM.xlsx.xlsm]A1 Do Not Use'!#REF!
BC39:BW43List='C:\My Documents\AMOC WPP\[Track access. SWP request form.xlsm]A2 Team Info'!#REF!
BC44:BW47List='[PK - TRACK ACCESS-SWP REQUEST FORM.xlsx.xlsm]A1 Do Not Use'!#REF!
AO39:AW39List=$K$2:$K$5
 
Upvote 0
Thanks for that.
For CB51 you can use
Excel Formula:
=MIN(CB51,CB30:CB31,IF(CB41=0,10^10,CB41),IF(CB43=0,10^10,CB43),IF(CB66=0,10^10,CB66),IF(CB69=0,10^10,CB69))=CB51
and for CB53
Excel Formula:
=MAX(CB53,CB30:CB31,CB41,CB43,CB66,CB69)=CB53
 
Upvote 0
Solution
Thanks for that.
For CB51 you can use
Excel Formula:
=MIN(CB51,CB30:CB31,IF(CB41=0,10^10,CB41),IF(CB43=0,10^10,CB43),IF(CB66=0,10^10,CB66),IF(CB69=0,10^10,CB69))=CB51
and for CB53
Excel Formula:
=MAX(CB53,CB30:CB31,CB41,CB43,CB66,CB69)=CB53
Thank you very much Fluff, that's it working now.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
HI Fluff,

Are you also good with VBA?

Looking for a code that will changes a number of individual cell based on a dropdown list selection.

Cell A1 dropdown selection is either "miles/chains" or "miles/yard" and I need cells C3, C9, C16 & C30 to change to "ch" if "miles/chains" is selected or to "yds" if "miles/yards" is selected?

Thanks in advance.
 
Upvote 0
As that is a totally different question, it needs a new thread. Thanks
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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