Conditional Formatting for 2,3,4,5 of the same numbers.

serge

Well-known Member
Joined
Oct 8, 2008
Messages
1,271
Office Version
  1. 2007
Platform
  1. Windows
Hi everyone,

I need help with a CF that would format when 2 numbers are the same or 3 the same or 4 or5.

A1:E1

43,43,48,52,55. the 2, 43 would be highlighted with 1 color.
or
43,43,43,52,55. the 3, 43 would be highlighted a different color, etc...

and if I have :

43,43,43,55,55. the 3, 43 and 2, 55 would be highlighted a different color each.

I hope it's clear enough ?

Thank you for help... Serge.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
Select the range A1:E1 and use this formula in conditional formatting

=COUNTIF($A1:$E1,A1)=2

format as required and repeat for 3, 4 and 5

(I assume you have Excel 2007 or later otherwise you are limited to 3 formats.....)
 

serge

Well-known Member
Joined
Oct 8, 2008
Messages
1,271
Office Version
  1. 2007
Platform
  1. Windows
Hi Barry,

Thank you very much, that's exactly what I needed.

Regards... Serge.
 

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,484
Barry, Great solution..

On a related note..
I've noticed (in xl2007) if you were to now Click on any cell A1:E1 (after applying the c/f) and you use the Format Painter to c/f the Range(B1:E4) - When you then click on say Cell C3, and then C/f Manage Rules - both the formula box and the Applys to box
show "strange" cell references. Am I seeing correctly?

Jim
 

Forum statistics

Threads
1,141,222
Messages
5,705,109
Members
421,378
Latest member
CarlosDuran

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