Complicate highlight between 2 ranges (27 unique combinations Vs 12 results)

motilulla

Well-known Member
Joined
Feb 13, 2008
Messages
2,362
Office Version
  1. 2010
Hello,

My result data are in the columns "D:O" and the unique combinations are in the columns "Q:AQ" the total of result matches Vs unique is shown in the column "AR"

I want to highlight in the each unique combinations row Vs each result row, example row6 with row6, row7 with row7 and so on...

The sample image is attached in which showing only 2 rows as an example

Please suggest VBA or formula for this complicate highlight solution

P1P2P3P4P5P6P7P8P9P10P11P12P1P2P3P4P5P6P7P8P9P10P11P12P13P14P15P16P17P18P19P20P21P22P23P24P25P26P27Matched
X,1,11,1,11,1,21,2,12,1,21,2,12,1,21,2,X2,X,1X,1,11,1,X1,X,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,29
X,X,2X,2,12,1,X1,X,XX,X,1X,1,11,1,21,2,12,1,X1,X,2X,2,12,1,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,210
X,1,11,1,11,1,21,2,12,1,21,2,12,1,21,2,X2,X,1X,1,11,1,X1,X,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
2,1,11,1,X1,X,2X,2,12,1,X1,X,1X,1,11,1,21,2,22,2,12,1,11,1,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
1,X,1X,1,X1,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12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
X,1,X1,X,2X,2,12,1,21,2,X2,X,XX,X,XX,X,1X,1,11,1,11,1,X1,X,X1,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
1,1,X1,X,1X,1,21,2,12,1,X1,X,1X,1,11,1,11,1,21,2,12,1,X1,X,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
1,1,11,1,11,1,11,1,X1,X,1X,1,11,1,11,1,21,2,22,2,X2,X,1X,1,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
X,1,11,1,X1,X,XX,X,1X,1,11,1,11,1,11,1,21,2,12,1,11,1,X1,X,X1,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
1,1,11,1,11,1,21,2,12,1,X1,X,XX,X,1X,1,21,2,X2,X,1X,1,X1,X,21,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
1,1,11,1,21,2,22,2,12,1,11,1,X1,X,1X,1,21,2,12,1,11,1,X1,X,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
2,1,X1,X,1X,1,11,1,X1,X,1X,1,11,1,11,1,21,2,12,1,11,1,11,1,21,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
1,1,11,1,11,1,11,1,21,2,12,1,11,1,21,2,12,1,X1,X,XX,X,XX,X,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
X,1,11,1,21,2,12,1,11,1,21,2,12,1,11,1,X1,X,1X,1,11,1,11,1,X1,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
1,1,11,1,11,1,X1,X,1X,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
X,1,11,1,11,1,11,1,21,2,12,1,11,1,X1,X,XX,X,1X,1,11,1,X1,X,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
1,2,X2,X,XX,X,XX,X,XX,X,1X,1,21,2,12,1,11,1,11,1,X1,X,1X,1,11,1,11,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X1,X,1X,1,X1,X,2X,2,12,1,21,2,22,2,12,1,X1,X,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
1,X,1X,1,21,2,12,1,11,1,11,1,11,1,11,1,11,1,X1,X,1X,1,X1,X,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
2,1,11,1,11,1,21,2,X2,X,1X,1,X1,X,XX,X,1X,1,11,1,X1,X,XX,X,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
1,X,XX,X,2X,2,12,1,11,1,21,2,X2,X,1X,1,11,1,X1,X,1X,1,21,2,X1,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
X,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,21,2,X2,X,XX,X,XX,X,X1,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2

Thank you all.

I am using Excel 2000

Regards,
Moti
 

Attachments

  • Complicate highlight.png
    Complicate highlight.png
    124.8 KB · Views: 5

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
highlighting is straight forward - using a countif() in conditional format
=COUNTIF($D6:$O6,Q6)>0

however counting the unique values , i'm having trouble with, will keep looking - maybe needs a macro to count coloured cells
also not used xl 2000 version for many years , not sure what functions you have - sumproduct()

Book7
DEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQ
5P1P2P3P4P5P6P7P8P9P10P11P12P1P2P3P4P5P6P7P8P9P10P11P12P13P14P15P16P17P18P19P20P21P22P23P24P25P26P27
6X,1,11,1,11,1,21,2,12,1,21,2,12,1,21,2,X2,X,1X,1,11,1,X1,X,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
7X,X,2X,2,12,1,X1,X,XX,X,1X,1,11,1,21,2,12,1,X1,X,2X,2,12,1,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
8X,1,11,1,11,1,21,2,12,1,21,2,12,1,21,2,X2,X,1X,1,11,1,X1,X,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
92,1,11,1,X1,X,2X,2,12,1,X1,X,1X,1,11,1,21,2,22,2,12,1,11,1,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
101,X,1X,1,X1,X,1X,1,11,1,21,2,12,1,11,1,X1,X,XX,X,XX,X,1X,1,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
11X,2,X2,X,XX,X,2X,2,X2,X,1X,1,11,1,21,2,12,1,11,1,11,1,11,1,21,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
12X,1,11,1,21,2,12,1,11,1,11,1,21,2,12,1,11,1,X1,X,1X,1,X1,X,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
131,X,XX,X,2X,2,12,1,X1,X,1X,1,11,1,11,1,21,2,12,1,11,1,X1,X,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
141,1,11,1,21,2,X2,X,XX,X,XX,X,1X,1,X1,X,XX,X,1X,1,X1,X,XX,X,X1,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
151,X,XX,X,1X,1,11,1,11,1,11,1,11,1,X1,X,1X,1,11,1,21,2,X2,X,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
16X,1,X1,X,2X,2,12,1,21,2,X2,X,XX,X,XX,X,1X,1,11,1,11,1,X1,X,X1,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
171,1,X1,X,1X,1,21,2,12,1,X1,X,1X,1,11,1,11,1,21,2,12,1,X1,X,11,1,11,1,X1,1,21,X,11,X,X1,X,21,2,11,2,X1,2,2X,1,1X,1,XX,1,2X,X,1X,X,XX,X,2X,2,1X,2,XX,2,22,1,12,1,X2,1,22,X,12,X,X2,X,22,2,12,2,X2,2,2
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
Q6:AQ37Expression=COUNTIF($D6:$O6,Q6)>0textNO
 
Last edited:
Upvote 0
Solution
highlighting is straight forward - using a countif() in conditional format
=COUNTIF($D6:$O6,Q6)>0

however counting the unique values , i'm having trouble with, will keep looking - maybe needs a macro to count coloured cells
also not used xl 2000 version for many years , not sure what functions you have - sumproduct()
Hello KRice, thank you so much CF worked as treat. Yes SUMPRODUCT function is available in the Excel 2000.

Kind Regards,
Moti
 
Upvote 0
Hello KRice, thank you so much CF worked as treat. Yes SUMPRODUCT function is available in the Excel 2000.

Kind Regards,
Moti
Hello KRice, as you mentioned "function sumproduct()" I goggled and tried many formulas finally got under this link which worked but instated "counting unique Vs unique" I did apply formula to "count unique with the result matches" it gave a correct result here is a formula and image attached


VBA Code:
Formula in Cell P6 Copied To Down =SUMPRODUCT(1/COUNTIF(D6:O6,D6:O6))
Formula in Cell Q6 Copied To Down =12-P6

I appreciate your help have nice weekend.

Kind Regards,
Moti
 

Attachments

  • Count Unique.png
    Count Unique.png
    134.2 KB · Views: 4
Upvote 0
glad you got it sorted
I miss-understood
I was under the impression I was counting how many Unique entries from D6 to O6 - appeared in the other table, so the ones highlighted , which may have not necessarily been all the Unique items in D6 to O6 as they may not have all appeared, although they did in your example, but only 1 may have appeared
 
Upvote 0
glad you got it sorted
I miss-understood
Hello KRice, absolutely not you thought correct as I mentioned I also just counted highlight manually and typed the matches, but after finding the formula and testing it with result side data I found it is giving the same matches so far I applied and let it informed you. It was me did not knew it how to count the match. I am sorry about the confusion. Thank you

Have a good day

Kind Regards,
Moti :)
 
Upvote 0
whos , Krice, i think you have the wrong name maybe
 
Upvote 0
whos , Krice, i think you have the wrong name maybe
Hello etaf, ?

I apologize for my mistake I were following you etaf, and how could I type the wrong name having you in my mind it is may be the stress not having a complete rest and working unlimited hours. I am so sorry etaf, please forgive me. Heartily thanks to you for all your help and time you took to solve my query.

May I request administrator to correct the name etaf, in the post #3, #4, and #6 (insted of KRice,) it is my typing error thank you for the attention and sorry for the inconveniences.

Kind Regards,
Moti
 
Upvote 0

Forum statistics

Threads
1,215,223
Messages
6,123,715
Members
449,118
Latest member
MichealRed

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