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.
 
YES, range names are correct. I think it's because of office 365.
760816f8-7f97-11eb-ba0e-366c9fa44b5f.xlsx
Y
127
Sheet1
Cell Formulas
RangeFormula
Y12Y12=SORT(IF(MMULT(--ISNUMBER(MATCH(MyData,MyPick,)),SEQUENCE(COLUMNS(MyData),,1,0))=COLUMNS(MyPick),ROW(MyData),""))
Named Ranges
NameRefers ToCells
MyData=Sheet1!$C$7:$V$7Y12
MyPick=Sheet1!$C$3:$I$3Y7:Y16
 
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
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
YES, range names are correct. I think it's because of office 365.
760816f8-7f97-11eb-ba0e-366c9fa44b5f.xlsx
CDEFGHIJKLMNOPQRSTUVWXY
11234567891011121314151617181920
2My pick numbers
39102124282938
4
5Match
60
791012192124282930343840464950586364717877
8101112202326283031343543455354566171768027
93916192430323334354448596163666970757827
1045671011161720232428343552565964657037
11101417222728294142464850545960626466717637
1291012192124282930343840464950586364717877
13469112021263335364041424750515760647327
14182021253236424853545557616263656875767917
153512212223323538424753596063666972747817
163910122128293637424850555963657172747527
17191018212226333436374050515365677174795
18281721233738394244505362646671727576793
Sheet1
Cell Formulas
RangeFormula
Y7:Y16Y7=SORT(IF(MMULT(--ISNUMBER(MATCH(MyData,MyPick,)),SEQUENCE(COLUMNS(MyData),,1,0))=COLUMNS(MyPick),ROW(MyData),""))
X6:X14X6=SUM(COUNTIF(C6:V6,MyPick))
X15:X18X15=SUM(COUNTIF(C14:V14,MyPick))
Named Ranges
NameRefers ToCells
MyData=Sheet1!$C$7:$V$7X7, Y7:Y16
MyPick=Sheet1!$C$3:$I$3X13:X14, Y7:Y16
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C7:V19674Expression=AND(SUM(COUNTIF($C7:$V7,MyPick))=COLUMNS(MyPick),ISNUMBER(MATCH(C7,MyPick,)))textNO
 
Upvote 0
YES, range names are correct.
No they're not. You've defined MyData as a single row, and presumably copied the SORT() formula down the column - hence the duplicated result: 5 in Post #9.

I have defined MyData as the entire range of data - all rows. My SORT() formula is an array formula which returns the two results 5 and 11 (and blanks below).

In Post #10, click on the Clipboard icon (above and to the left of cell A1) and you can paste directly into a worksheet to see how my formulae work.
 
Upvote 0
yes are right but now it's giving an error!!
760816f8-7f97-11eb-ba0e-366c9fa44b5f.xlsx
CDEFGHIJKLMNOPQRSTUVWXY
11234567891011121314151617181920
2My pick numbers
39102124282938
4
5Match
6
79101219212428293034384046495058636471787#SPILL!
810111220232628303134354345535456617176802#SPILL!
9391619243032333435444859616366697075782#SPILL!
104567101116172023242834355256596465703#SPILL!
1110141722272829414246485054596062646671763#SPILL!
129101219212428293034384046495058636471787#SPILL!
1346911202126333536404142475051576064732#SPILL!
1418202125323642485354555761626365687576791#SPILL!
15351221222332353842475359606366697274782#SPILL!
16391012212829363742485055596365717274755#SPILL!
17191018212226333436374050515365677174793#SPILL!
Sheet1
Cell Formulas
RangeFormula
X7:X17X7=SUM(COUNTIF(C7:V7,MyPick))
Y7:Y17Y7=SORT(IF(MMULT(--ISNUMBER(MATCH(MyData,MyPick,)),SEQUENCE(COLUMNS(MyData),,1,0))=COLUMNS(MyPick),ROW(MyData),""))
Named Ranges
NameRefers ToCells
MyData=Sheet1!$C$7:$V$17Y7:Y17, X7
MyPick=Sheet1!$C$3:$I$3Y7:Y18
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C7:V19674Expression=AND(SUM(COUNTIF($C7:$V7,MyPick))=COLUMNS(MyPick),ISNUMBER(MATCH(C7,MyPick,)))textNO
 
Upvote 0
there is something I'm missing. I copied your sheet from the clipboard but it only coping in Text format, even coping with ALT+click.
Named RangesNameRefers ToCells
MyData=Sheet1!$C$5:$V$14 X5, Z5 how did you give reference to these cells.
MyPick=Sheet1!$C$3:$I$3Z5, X5:X14

 
Upvote 0
The array formula goes in Y7 only. Delete your formulae in the cells below.
it worked!! I literally learned a new way to sort out this problem. I can't thank you enough for your Help.

760816f8-7f97-11eb-ba0e-366c9fa44b5f.xlsx
CDEFGHIJKLMNOPQRSTUVWXY
11234567891011121314151617181920
2My pick numbers
39102124282938
4
5MatchRow NO.
6
791012192124282930343840464950586364717877
81011122023262830313435434553545661717680212
9391619243032333435444859616366697075782
104567101116172023242834355256596465703
1110141722272829414246485054596062646671763
129101219212428293034384046495058636471787
1346911202126333536404142475051576064732
1418202125323642485354555761626365687576791
15351221222332353842475359606366697274782
16391012212829363742485055596365717274755
Sheet1
Cell Formulas
RangeFormula
Y7:Y17Y7=SORT(IF(MMULT(--ISNUMBER(MATCH(MyData,MyPick,)),SEQUENCE(COLUMNS(MyData),,1,0))=COLUMNS(MyPick),ROW(MyData),""))
X7:X16X7=SUM(COUNTIF(C7:V7,MyPick))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
MyData=Sheet1!$C$7:$V$17X7:Y7
MyPick=Sheet1!$C$3:$I$3Y7
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C7:V19674Expression=AND(SUM(COUNTIF($C7:$V7,MyPick))=COLUMNS(MyPick),ISNUMBER(MATCH(C7,MyPick,)))textNO
 
Upvote 0

Forum statistics

Threads
1,214,986
Messages
6,122,611
Members
449,090
Latest member
vivek chauhan

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