Highlight values within specific ranges
Answer:
Conditional formatting formulas
Green:=OR(ABS(A4-$A$2:$D$2)<$F$1)
Red:=AND(ABS(A4-$A$2:$D$2)>=$F$1)
How to apply conditional formatting formulas
- Select cell range (A4:D18)
- Go to tab "
- Click "Conditional formatting" button
- Click "New Rule..."
- Click "Use a formula to determine which cells to format"
- Paste "green" formula in field
- Click "Format" button
- Go to tab "Fill"
- Select a color
- Click ok
- click ok
Explaining "green" formula in cell A4
Step 1 - Subtract array of values ($A$2:$D$2) from value in cell A4
A4-$A$2:$D$2
becomes
2-{34, 57, 93, 75}
and returns
{-32, -55, -91, -73}
Step 2 - Return the absolute value of a number
ABS(A4-$A$2:$D$2)
becomes
ABS({-32, -55, -91, -73})
and returns
{32, 55, 91, 73}
Step 3 - Check if values are less than value in cell $F$1
ABS(A4-$A$2:$D$2)<$F$1
becomes
{32, 55, 91, 73}<4
and returns
{FALSE, FALSE, FALSE, FALSE}
Step 4 - Return FALSE only if all values are FALSE
OR(ABS(A4-$A$2:$D$2)<$F$1)
becomes
OR({FALSE, FALSE, FALSE, FALSE})
and returns FALSE. Cell A4 is not highlighted green.
Download *.xlsx file
Merit.xlsx
Related posts:
Highlight specific time ranges in a weekly schedule in excel
Highlight overlapping date ranges using conditional formatting in excel
Excel: Count and sum values between specific ranges in a column
Highlight unique distinct values in two ranges combined using conditional formatting in excel
Sort numeric values by closest to farthest to a specific number in excel (array formula)


















Thanks Oscar, Huge help!