CF formula for rows.

serge

Well-known Member
Joined
Oct 8, 2008
Messages
1,446
Office Version
  1. 2007
Platform
  1. Windows
Hi, I'm looking for a CF that will highlight the digits in rows according the digit put in cells of row 2.
It is separated this way because there is some more numbers that come in play but I remove to not be confusing, so sorry if there is 3 columns in between !

Original table :

125.png


Like in this example below, if I type a 1 in cell AT2, the cells in row 4,5,12,13 and 17 will highlight because they all contain the digit 1 in their second position.

126.png

Then if I type digit 3 in cell AO2 row 17 will be removed, because it has no 3 in first position.

127.png


Then if I type a 1 in cell BA2 then row 4,5 and 12 also will be removed leaving me with row 13 only.
My goal is to be left with only 1 number at the end according to the selections made in row 2.

128.png


Let say if I type a 3 in cell BH2 then it will only highlight row 4 which where I won't need no more selection to reduce to 1 number.
It might be a complicated CF but it will HELP me so much.

Thank you.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
There's one example above that doesn't seem right to me, where you have a 3 and a 1, but rows 4 and 5 still have color despite not having a 3 in the first group of digits. If the example below is correct, then I'm misunderstanding what you want.

127.png



You would have to create a lot of rules if you want to keep the colors, but this conditional formatting formula appears to work for the rest of the examples:

Excel Formula:
=AND(AN4<>"",SUM(($AN4:$BH4=$AN$2:$BH$2)*($AN$2:$BH$2<>""))=SUM(--($AN$2:$BH$2<>"")))
 
Upvote 0
There's one example above that doesn't seem right to me, where you have a 3 and a 1, but rows 4 and 5 still have color despite not having a 3 in the first group of digits. If the example below is correct, then I'm misunderstanding what you want.

View attachment 115884


You would have to create a lot of rules if you want to keep the colors, but this conditional formatting formula appears to work for the rest of the examples:

Excel Formula:
=AND(AN4<>"",SUM(($AN4:$BH4=$AN$2:$BH$2)*($AN$2:$BH$2<>""))=SUM(--($AN$2:$BH$2<>"")))
Nice formula, I thought maybe there was something simpler than what I was imagining, but I couldn't think of it. However, it doesn't seem to work for the following combination:
Book1
ANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJ
1234123012123
2310
3
421032103
521212121
6
722022202
822112211
9
1023012301
11
1231023102
1331113111
14
1532013201
16
1741014101
Sheet4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AN4:BH17Expression=AN4<>""textNO
AN4:BH17Expression=AND(AN4<>"",SUM(($AN4:$BH4=$AN$2:$BH$2)*($AN$2:$BH$2<>""))=SUM(--($AN$2:$BH$2<>"")))textNO


The 1 in BA2 works, but not the 0 in AZ2. Or any 0s really:

Book1
ANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJ
1234123012123
201
3
421032103
521212121
6
722022202
822112211
9
1023012301
11
1231023102
1331113111
14
1532013201
16
1741014101
Sheet4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AN4:BH17Expression=AN4<>""textNO
AN4:BH17Expression=AND(AN4<>"",SUM(($AN4:$BH4=$AN$2:$BH$2)*($AN$2:$BH$2<>""))=SUM(--($AN$2:$BH$2<>"")))textNO
 
Last edited:
Upvote 0
Nice formula, I thought maybe there was something simpler than what I was imagining, but I couldn't think of it. However, it doesn't seem to work for the following combination:
Book1
ANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJ
1234123012123
2310
3
421032103
521212121
6
722022202
822112211
9
1023012301
11
1231023102
1331113111
14
1532013201
16
1741014101
Sheet4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AN4:BH17Expression=AN4<>""textNO
AN4:BH17Expression=AND(AN4<>"",SUM(($AN4:$BH4=$AN$2:$BH$2)*($AN$2:$BH$2<>""))=SUM(--($AN$2:$BH$2<>"")))textNO


The 1 in BA2 works, but not the 0 in AZ2. Or any 0s really:

Book1
ANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJ
1234123012123
201
3
421032103
521212121
6
722022202
822112211
9
1023012301
11
1231023102
1331113111
14
1532013201
16
1741014101
Sheet4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AN4:BH17Expression=AN4<>""textNO
AN4:BH17Expression=AND(AN4<>"",SUM(($AN4:$BH4=$AN$2:$BH$2)*($AN$2:$BH$2<>""))=SUM(--($AN$2:$BH$2<>"")))textNO

Good catch! I completely missed the 0 throwing things off. I believe this conditional formatting formula will fix that:
Excel Formula:
=AND(AN4<>"",SUM(EXACT($AN4:$BH4,$AN$2:$BH$2)*($AN$2:$BH$2<>""))=SUM(--($AN$2:$BH$2<>"")))
 
Upvote 0
There's one example above that doesn't seem right to me, where you have a 3 and a 1, but rows 4 and 5 still have color despite not having a 3 in the first group of digits. If the example below is correct, then I'm misunderstanding what you want.

View attachment 115884


You would have to create a lot of rules if you want to keep the colors, but this conditional formatting formula appears to work for the rest of the examples:

Excel Formula:
=AND(AN4<>"",SUM(($AN4:$BH4=$AN$2:$BH$2)*($AN$2:$BH$2<>""))=SUM(--($AN$2:$BH$2<>"")))
Hi Vogateer, you are right row 4 and 5 should have not been colored ( my mistake ) I apologize.
 
Upvote 0
Vogateer, Thank you so much, your last formula work PERFECTLY fine.
Thank you so much for the help.
 
Upvote 0
dreid1011, Thank you too also for the help really appreciate it.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,157
Members
453,021
Latest member
Justyna P

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