Need help with conditional formula

neil_c

New Member
Joined
Mar 6, 2021
Messages
13
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I have a spreadsheet with thousands of rows containing numbers 1-20. I want to highlight specific numbers 3, 5, 8, 9, 15, 20 (7 numbers), etc.
Is there any formula for highlighting a row that has exactly 7 numbers? Do not highlight if any row contains one or two identical numbers. Basically, highlight the line that has the specific numbers 3,5,8,9,15,20.

1. example: 3,5,8,9,15,20,25= match 7number highlight (if possible a column can tell how many numbers matched with that row e.g.7)
3,5,7,16,21,24= do not highlight(even if it has few same number. ( here column can tell how many matched but do not highlight)
2. In addition, is there way if 7 number match in particular row then a coulum can tell ok 7 number matched in rows number 5.

Huge thanks!!
1615085971475.png

2.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi,

I'm not understanding your description clearly, and your screenshot sample for "1." seems incomplete
Your screenshot sample for "2." is missing.

I suggest you upload samples with detailed descriptions of what you expect as results using XL2BB, see my signature for link and info.

So, I'm only addressing the Count of 3,5,8,9,15,20,25 per row:

Book3.xlsx
ABCDEFGHIJKLMNOPQRSTUV
135891525
21234567891011121314151617181920
311162225293032394041424452545565717478791
Sheet831
Cell Formulas
RangeFormula
V3V3=SUM(COUNTIF(A3:T3,{3,5,8,9,15,20,25}))
 
Upvote 0
Welcome to the Forum!

Maybe like this (assuming numbers can't be duplicated within any row):

ABCDEFGHIJKLMNOPQRSTUV
13589152025
29101319202529344148495152535960686972783
38111215181921273233504447485057626769742
4281417202223243646475866677172737476772
5371318262829323840475261626364657075791
6345891012152023252729303138455366677
710121720252930333436383940545766697475772
812161718192026363739454849565960656768691
9192628293032354446495256586365667071721
104101113202629303133344153545962637176771
1122314152036404446505152536371737677793
12
13                   
14Row number5
15in MyData
Sheet1
Cell Formulas
RangeFormula
V2:V11V2=SUM(COUNTIF(A2:T2,MyPick))
B13:T13C13=IF(C2=B2,9999,"")
B14B14=MATCH(7,MMULT(--ISNUMBER(MATCH(A2:T11,MyPick,)),SEQUENCE(COLUMNS(MyData),,1,0)))
Named Ranges
NameRefers ToCells
MyData=Sheet1!$A$2:$T$11V2, B13:B14
MyPick=Sheet1!$A$1:$G$1B14, V2:V11
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:U11Expression=SUM(COUNTIF($A2:$T2,MyPick))=7textNO


The 5th row is the first occurrence. Let us know if you want a formula for 2nd and subsequent occurrences?

The SEQUENCE part of the formula can be modified if required for earlier versions of Excel.
 
Upvote 0
thank your
Hi,

I'm not understanding your description clearly, and your screenshot sample for "1." seems incomplete
Your screenshot sample for "2." is missing.

I suggest you upload samples with detailed descriptions of what you expect as results using XL2BB, see my signature for link and info.

So, I'm only addressing the Count of 3,5,8,9,15,20,25 per row:

Book3.xlsx
ABCDEFGHIJKLMNOPQRSTUV
135891525
21234567891011121314151617181920
311162225293032394041424452545565717478791
Sheet831
Cell Formulas
RangeFormula
V3V3=SUM(COUNTIF(A3:T3,{3,5,8,9,15,20,25}))

Hi,

I'm not understanding your description clearly, and your screenshot sample for "1." seems incomplete
Your screenshot sample for "2." is missing.

I suggest you upload samples with detailed descriptions of what you expect as results using XL2BB, see my signature for link and info.

So, I'm only addressing the Count of 3,5,8,9,15,20,25 per row:

Book3.xlsx
ABCDEFGHIJKLMNOPQRSTUV
135891525
21234567891011121314151617181920
311162225293032394041424452545565717478791
Sheet831
Cell Formulas
RangeFormula
V3V3=SUM(COUNTIF(A3:T3,{3,5,8,9,15,20,25}))
thank you for your reply.
 
Upvote 0
Welcome to the Forum!

Maybe like this (assuming numbers can't be duplicated within any row):

ABCDEFGHIJKLMNOPQRSTUV
13589152025
29101319202529344148495152535960686972783
38111215181921273233504447485057626769742
4281417202223243646475866677172737476772
5371318262829323840475261626364657075791
6345891012152023252729303138455366677
710121720252930333436383940545766697475772
812161718192026363739454849565960656768691
9192628293032354446495256586365667071721
104101113202629303133344153545962637176771
1122314152036404446505152536371737677793
12
13                   
14Row number5
15in MyData
Sheet1
Cell Formulas
RangeFormula
V2:V11V2=SUM(COUNTIF(A2:T2,MyPick))
B13:T13C13=IF(C2=B2,9999,"")
B14B14=MATCH(7,MMULT(--ISNUMBER(MATCH(A2:T11,MyPick,)),SEQUENCE(COLUMNS(MyData),,1,0)))
Named Ranges
NameRefers ToCells
MyData=Sheet1!$A$2:$T$11V2, B13:B14
MyPick=Sheet1!$A$1:$G$1B14, V2:V11
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:U11Expression=SUM(COUNTIF($A2:$T2,MyPick))=7textNO


The 5th row is the first occurrence. Let us know if you want a formula for 2nd and subsequent occurrences?

The SEQUENCE part of the formula can be modified if required for earlier versions of Excel.
boom!! Huge thanks. wonderful this is exactly what I was looking for. Just a quick question: is it possible just to highlight only match numbers rather than the whole row. AND
yes, if you could provide a formula for 2nd and subsequent occurrences for the same matches. (Match numbers are in row 6 so why row 5 came up.)
huge thanks!!
 
Upvote 0
Using 365 (it's possible in earlier versions, just different formulae) ...

ABCDEFGHIJKLMNOPQRSTUV
13589152025
29101319202529344148495152535960686972783
38111215181921273233504447485057626769742
4281417202223243646475866677172737476772
5371318262829323840475261626364657075791
6345891012152023252729303138455366677
710121720252930333436383940545766697475772
812161718192026363739454849565960656768691
913578910141519202533586365667071727
104101113202629303133344153545962637176771
1122314152036404446505152536371737677793
12
13                   
14Row nos6
159
Sheet1
Cell Formulas
RangeFormula
V2:V11V2=SUM(COUNTIF(A2:T2,MyPick))
B13:T13C13=IF(C2=B2,9999,"")
B14:B15B14=LET(x,IF(MMULT(--ISNUMBER(MATCH(MyData,MyPick,)),SEQUENCE(COLUMNS(MyData),,1,0))=COLUMNS(MyPick),ROW(MyData)),FILTER(x,x<>FALSE))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
MyData=Sheet1!$A$2:$T$11V2, B13:B14
MyPick=Sheet1!$A$1:$G$1B14, V2:V11
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:U11Expression=AND(SUM(COUNTIF($A2:$T2,MyPick))=COLUMNS(MyPick),ISNUMBER(MATCH(A2,MyPick,)))textNO
 
Upvote 0
Using 365 (it's possible in earlier versions, just different formulae) ...

ABCDEFGHIJKLMNOPQRSTUV
13589152025
29101319202529344148495152535960686972783
38111215181921273233504447485057626769742
4281417202223243646475866677172737476772
5371318262829323840475261626364657075791
6345891012152023252729303138455366677
710121720252930333436383940545766697475772
812161718192026363739454849565960656768691
913578910141519202533586365667071727
104101113202629303133344153545962637176771
1122314152036404446505152536371737677793
12
13                   
14Row nos6
159
Sheet1
Cell Formulas
RangeFormula
V2:V11V2=SUM(COUNTIF(A2:T2,MyPick))
B13:T13C13=IF(C2=B2,9999,"")
B14:B15B14=LET(x,IF(MMULT(--ISNUMBER(MATCH(MyData,MyPick,)),SEQUENCE(COLUMNS(MyData),,1,0))=COLUMNS(MyPick),ROW(MyData)),FILTER(x,x<>FALSE))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
MyData=Sheet1!$A$2:$T$11V2, B13:B14
MyPick=Sheet1!$A$1:$G$1B14, V2:V11
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:U11Expression=AND(SUM(COUNTIF($A2:$T2,MyPick))=COLUMNS(MyPick),ISNUMBER(MATCH(A2,MyPick,)))textNO
THANK you a lot sir.
I'm using 365 but after struggling a lot of time these two formulas are not working :
B13:T13C13=IF(C2=B2,9999,"")
B14:B15B14=LET(x,IF(MMULT(--ISNUMBER(MATCH(MyData,MyPick,)),SEQUENCE(COLUMNS(MyData),,1,0))=COLUMNS(MyPick),ROW(MyData)),FILTER(x,x<>FALSE))
1615111401760.png
 
Upvote 0
It looks like you don't have the LET function yet. Is your Excel 365 fully up-to-date?

You could also try:

ABCDEFGHIJKLMNOPQRSTUVWX
13589152025
29101319202529344148495152535960686972783Row nos6
381112151819212732335044474850576267697429
4281417202223243646475866677172737476772
5371318262829323840475261626364657075791
6345891012152023252729303138455366677
710121720252930333436383940545766697475772
812161718192026363739454849565960656768691
913578910141519202533586365667071727
104101113202629303133344153545962637176771
1122314152036404446505152536371737677793
Sheet1
Cell Formulas
RangeFormula
X2:X11X2=SORT(IF(MMULT(--ISNUMBER(MATCH(MyData,MyPick,)),SEQUENCE(COLUMNS(MyData),,1,0))=COLUMNS(MyPick),ROW(MyData),""))
V2:V11V2=SUM(COUNTIF(A2:T2,MyPick))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
MyData=Sheet1!$A$2:$T$11V2, X2
MyPick=Sheet1!$A$1:$G$1X2, V2:V11
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:U11Expression=AND(SUM(COUNTIF($A2:$T2,MyPick))=COLUMNS(MyPick),ISNUMBER(MATCH(A2,MyPick,)))textNO
 
Upvote 0
It looks like you don't have the LET function yet. Is your Excel 365 fully up-to-date?

You could also try:

ABCDEFGHIJKLMNOPQRSTUVWX
13589152025
29101319202529344148495152535960686972783Row nos6
381112151819212732335044474850576267697429
4281417202223243646475866677172737476772
5371318262829323840475261626364657075791
6345891012152023252729303138455366677
710121720252930333436383940545766697475772
812161718192026363739454849565960656768691
913578910141519202533586365667071727
104101113202629303133344153545962637176771
1122314152036404446505152536371737677793
Sheet1
Cell Formulas
RangeFormula
X2:X11X2=SORT(IF(MMULT(--ISNUMBER(MATCH(MyData,MyPick,)),SEQUENCE(COLUMNS(MyData),,1,0))=COLUMNS(MyPick),ROW(MyData),""))
V2:V11V2=SUM(COUNTIF(A2:T2,MyPick))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
MyData=Sheet1!$A$2:$T$11V2, X2
MyPick=Sheet1!$A$1:$G$1X2, V2:V11
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:U11Expression=AND(SUM(COUNTIF($A2:$T2,MyPick))=COLUMNS(MyPick),ISNUMBER(MATCH(A2,MyPick,)))textNO
Thanks, both formulas are working now in the web browser. In fact, I have a Uni365 subscription, so I think there's a problem with my office. The sort formula only marking row no.5. however, it should mark row 11 too. But thank you for taking the time to sort it out! Marking this solution solved.
1615257848852.png
 
Upvote 0
The sort formula only marking row no.5. however, it should mark row 11 too.
It works OK for me. Are you sure you've defined your range names correctly?

ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
2
39102124282938
4
591066662124282966663866666666666666666675
66666666666666666666666666666666666666666011
766666666666666666666666666666666666666660
866666666666666666666666666666666666666660
966666666666666666666666666666666666666660
1066666666666666666666666666666666666666660
119106666212428293866666666666666666666667
1266666666666666666666666666666666666666660
1366666666666666666666666666666666666666660
1466666666666666666666666666666666666666660
Sheet1
Cell Formulas
RangeFormula
Z5:Z14Z5=SORT(IF(MMULT(--ISNUMBER(MATCH(MyData,MyPick,)),SEQUENCE(COLUMNS(MyData),,1,0))=COLUMNS(MyPick),ROW(MyData),""))
X5:X14X5=SUM(COUNTIF(C5:V5,MyPick))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
MyData=Sheet1!$C$5:$V$14X5, Z5
MyPick=Sheet1!$C$3:$I$3Z5, X5:X14
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C5:W14Expression=AND(SUM(COUNTIF($C5:$V5,MyPick))=COLUMNS(MyPick),ISNUMBER(MATCH(C5,MyPick,)))textNO
 
Upvote 0

Forum statistics

Threads
1,214,560
Messages
6,120,217
Members
448,951
Latest member
jennlynn

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