Find if specific values are on the same line

Cypress

New Member
Joined
Jun 22, 2019
Messages
2
Hello everyone.
I am new to Mr.excel. I hope I will make myself clear of what I need to do.
I have a sheet of numbers and I need to find if 4 specific numbers are on the same line.
For example if “1” and “23” and “54” and “132” are on the same line I need to get informed somehow. f.e. make the whole line red or something like that.
Obviously, I need to check the whole sheet for any occurrences.
Thank you in advance.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
are on the same line I need to get informed somehow. f.e. make the whole line red or something like that.
You can try, select range and put formula in Conditional Formatting
Code:
=COUNTIF($A2:$H2,$M$2)+COUNTIF($A2:$H2,$N$2)+COUNTIF($A2:$H2,$O$2)+COUNTIF($A2:$H2,$P$2)=4
or
Code:
=SUMPRODUCT((($A2:$H2=$M$2)+($A2:$H2=$N$2)+($A2:$H2=$O$2)+($A2:$H2=$P$2)))=4

[TABLE="width: 1110"]
<tbody>[TR]
[TD]Row/Col[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[TD]L[/TD]
[TD]M[/TD]
[TD]N[/TD]
[TD]O[/TD]
[TD]P[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Num1[/TD]
[TD]Num2[/TD]
[TD]Num3[/TD]
[TD]Num4[/TD]
[TD]Num5[/TD]
[TD]Num6[/TD]
[TD]Num7[/TD]
[TD]Num8[/TD]
[TD][/TD]
[TD]Countif[/TD]
[TD]Sumproduct[/TD]
[TD][/TD]
[TD]Criteria1[/TD]
[TD]Criteria2[/TD]
[TD]Criteria3[/TD]
[TD]Criteria4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]23[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]54[/TD]
[TD="align: right"]124[/TD]
[TD="align: right"]132[/TD]
[TD][/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]23[/TD]
[TD="align: right"]54[/TD]
[TD="align: right"]132[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]54[/TD]
[TD="align: right"]132[/TD]
[TD="align: right"]200[/TD]
[TD][/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]23[/TD]
[TD="align: right"]54[/TD]
[TD="align: right"]132[/TD]
[TD="align: right"]200[/TD]
[TD][/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]23[/TD]
[TD="align: right"]54[/TD]
[TD="align: right"]132[/TD]
[TD="align: right"]200[/TD]
[TD][/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0
I tried the first solution you suggested. IFCOUNT
It worked perfectly.
Thank you very much for your quick response.
 
Upvote 0

Forum statistics

Threads
1,223,895
Messages
6,175,257
Members
452,625
Latest member
saadat28

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