Conditional formatting

RAJESH1960

Active Member
Joined
Mar 26, 2020
Messages
464
Office Version
  1. 2019
Platform
  1. Windows
Hi, I have already asked this question before and was answered by etaf, but I have one more correction to be made. So I am posting again .
I have figures in column F. I want to color the whole row if the value is unique, i.e., if it is not repeated. If the difference is less than 1 then too it should color the row. The second condition is that the values / text in column B should be the same.
Book4
BCDEF
1A87091.00
2A87091.20
3B7040.00
4C114534.00
5C114534.40
6D275940.00
7D275940.22
8E13650.00
9E13650.50
10F33264.00
11F33264.00
12G34020.00
13H39060.00
14H39060.67
15I68250.00
16I68250.00
17Z68250.00
18J929.00
19J929.25
20K1147.00
21K1147.00
22L1549.00
23L1549.44
24M1549.00
25M1549.00
26N1859.00
27N1859.00
28O2514.00
29O2514.00
30P2514.00
31P2514.14
32Q4026.00
33Q4026.00
34R4956.00
35R4956.00
Sheet1
 
Last edited:

etaf

Well-known Member
Joined
Oct 24, 2012
Messages
4,663
Office Version
  1. 365
Platform
  1. MacOS
OH OK, was not expecting that , as its only testing .5 between each number
so lets say we have
7090 & 7090.2 & 7091.3 & 7091.9 for january
Then 7091.9 will highlight as its not + or - 0.5 from the others

But I think you DO NOT want it highlighted if 1 difference

Book6
ABCDEF
1January7091
2January7091.2
3January7091.3
4january7091.9
5March4534.4
6April5940
7April5940.22
8May5940
9June1365
10July1000
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:F30Expression=COUNTIFS($B$1:$B$100,$B1,$F$1:$F$100,"<"&$F1+0.5,$F$1:$F$100,">"&$F1-0.5)=1textNO
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

RAJESH1960

Active Member
Joined
Mar 26, 2020
Messages
464
Office Version
  1. 2019
Platform
  1. Windows
etaf. If I try to change the range to 4000 rows in the formulas, I am not getting the expected. Will share the sheet again tomorrow. Time to hit the sack.
 

etaf

Well-known Member
Joined
Oct 24, 2012
Messages
4,663
Office Version
  1. 365
Platform
  1. MacOS
yes the range needs to change to support your range of rows
=COUNTIFS($B$1:$B$100,$B1,$F$1:$F$100,"<"&$F1+0.5,$F$1:$F$100,">"&$F1-0.5)=1
change the range
=COUNTIFS($B$1:$B$4000,$B1,$F$1:$F$4000,"<"&$F1+0.5,$F$1:$F$4000,">"&$F1-0.5)=1
OR increase to more rows - just depends on data
you could just reference the complete column BUT that is not very efficient for excel
=COUNTIFS($B:$B,$B1,$F:$F,"<"&$F1+0.5,$F:$F,">"&$F1-0.5)=1
 
Solution

RAJESH1960

Active Member
Joined
Mar 26, 2020
Messages
464
Office Version
  1. 2019
Platform
  1. Windows

ADVERTISEMENT

yes the range needs to change to support your range of rows
=COUNTIFS($B$1:$B$100,$B1,$F$1:$F$100,"<"&$F1+0.5,$F$1:$F$100,">"&$F1-0.5)=1
change the range
=COUNTIFS($B$1:$B$4000,$B1,$F$1:$F$4000,"<"&$F1+0.5,$F$1:$F$4000,">"&$F1-0.5)=1
OR increase to more rows - just depends on data
you could just reference the complete column BUT that is not very efficient for excel
=COUNTIFS($B:$B,$B1,$F:$F,"<"&$F1+0.5,$F:$F,">"&$F1-0.5)=1
Just copy paste the same data about 10 times below the last empty row and check. The above cells which were colored are also effected.
 

etaf

Well-known Member
Joined
Oct 24, 2012
Messages
4,663
Office Version
  1. 365
Platform
  1. MacOS
Just copy paste the same data about 10 times below the last empty row and check. The above cells which were colored are also effected.
sorry dont understand
 

RAJESH1960

Active Member
Joined
Mar 26, 2020
Messages
464
Office Version
  1. 2019
Platform
  1. Windows
sorry dont understand
Your formula works in a fixed data sheet, but if I change the date or add additional rows to the data the formula doesn't work. I think I will go with this formula until I am able to explain you better again next time. Till then this will do. Thanks etaf.
=COUNTIFS($B$1:$B$4000,$B1,$F$1:$F$4000,"<"&$F1+0.5,$F$1:$F$4000,">"&$F1-0.5)=1
 

Watch MrExcel Video

Forum statistics

Threads
1,129,508
Messages
5,636,733
Members
416,937
Latest member
crispix

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
Top