trying to figure conditional format for 2 columns of ID's

neowok

Board Regular
Joined
Mar 24, 2005
Messages
68
I have 2 columns of ID's, both of which may contain duplicates or blanks. What I need to do is if an ID in column A has textlonger than 3 characters in the same row in column B then *every occurance* of that Id in column A should be coloured red. I am basically flagging up that if an Id in column A has been allocated to something in column B then all occurances of that Id in colunm A can no longer be used, so colour anything with that Id in red.

So if column A had 5 occurances of LP111, and any one of those had XYZABCDE in column B then all 5 cells with that ID in column A would be red.

I'm sure its not that hard, just struggling to get my head around the logic for it.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
for your example

=(SUMPRODUCT((A$1:A$5=A1)*(LEN(B$1:B$5)>3))>0)

If you select the whole range of column A then it would probably have to be

=(SUMPRODUCT((A$1:A$5=A$1)*(LEN(B$1:B$5)>3))>0)

Obviously adjust the finishing row number as required.
 
Last edited:
Upvote 0
Try this
Select A2:Axx and apply the Conditional Formatting (use a formula) shown.

Excel Workbook
AB
1IDData
2ID 1abc
3ID 2de
4ID 3e
5
6ID 3dfrgt
7ID 4
8ID 545x
9ID 7abcd
10
11ID 3sd
12ID 4sfasfasfas
13ID 5ss
14ID 1
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A21. / Formula is =AGGREGATE(14,6,LEN(B$2:B$14)/(A$2:A$14=A2),1)>3Abc
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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