Simple colour coding of column data

Bebbspoke

Board Regular
Joined
Oct 10, 2014
Messages
193
Hi Peoples - plz - Conditional formatting of column (text) data req: -

if A1 = A2 then A2 is same fill colour as A1... strings down data column...
&
if A1 <> A2 then A2 is different colour to A1... strings down data column...

Seems highly useful for quick visual reference change of similar data blocks; - but darned if I can suss out the Conditional Formatting syntax!!!

Thank you,
Bebbspoke
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
It's been half a decade since I've posted here. But if I'm understanding you problem, can you just use conditional formatting in A2. Custom Formula: =(A1=A2)

Then use regular formatting in A1, but not in A2?
 
Upvote 0
If I have understood correctly, here is one way that keeps the CF syntax very simple.

1. Put a 1 (or -1) in F1, or row 1 of any available column.
2. Put the formula shown in row 2 of that column & copy down as far as you might ever need (after adjusting the $1000 to be greater than the number of rows of data you will ever have)
3. Select A2:F?? (I've used A2:F20, being where my column F formulas end) and apply the Conditional Formatting shown.
4. Column F can now be hidden if you want.

Excel Workbook
ABCDEF
1User IDOther 1Other 2Other 3Other 41
2a-1
3a-1
4b1
5b1
6b1
7b1
8c-1
9c-1
10c-1
11d1
12e-1
131
141
15f-1
16f-1
17g1
180
190
200
Cond Format Groups
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F21. / Formula is =$F2=1Abc
 
Upvote 0
Thanks Peter - I'll give your suggestion a try... PA's suggestion did not quite "behave" at the end of each block...
Your example shows both consistent behaviour and ability to remain true when blanks occur in the data.
I was hoping to avoid creating further rows - as there is much data & processing already & eventually I wish to make a spreadsheet to import block data from other sources... anyways... no sweat really with another column.. it's just nice & tidy were it one conditional rule for the one column...
Cheers & thanks again,
Bebbspoke
 
Upvote 0
I was hoping to avoid creating further rows ..
I assume you mean columns, not rows.

This can be done without the helper column, but it somewhat defeats you other consideration ..
... as there is much data & processing already
.. as there is probably more processing this way, especially since Conditional Formatting is volatile

For this one, select A3:D?? and apply the CF shown.

Excel Workbook
ABCD
1Hdr 1Hdr 2Hdr 3Hdr 4
2A
3A
4A
5B
6B
7C
8C
9C
10
11D
12D
13E
14
15
Cond Format In Groups
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A31. / Formula is =IF(COUNTA($A3:$A$1000),MOD(SUMPRODUCT(--($A$2:$A2<>$A$3:$A3)),2),0)Abc
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

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