MMULT looking to count all matches in a row including a single value

Stephen_IV

Well-known Member
Joined
Mar 17, 2003
Messages
1,168
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I am looking to count all matches in a row including a single value. The count I am looking for is 6. It does not matter where the number starts in the row. I know that this is a job for mmult but just can't get it.

Thanks in advance
Stephen
Book1
ABCDEFGHIJ
1L NameF NameDOBGrade020304050607
2xxxxxxyyyyyy12
3xxxxxxyyyyyy1434141
4xxxxxxyyyyyy17272727272
5xxxxxxyyyyyy145
6xxxxxxyyyyyy145454568
7xxxxxxyyyyyy1494949495252
8xxxxxxyyyyyy1757575
9xxxxxxyyyyyy1444444447514
10xxxxxxyyyyyy1444444444444
11xxxxxxyyyyyy14444444355
12xxxxxxyyyyyy1444444234343
13xxxxxxyyyyyy14444799
14xxxxxxyyyyyy14444443232
15xxxxxxyyyyyy144447910
16xxxxxxyyyyyy13030302626
17xxxxxxyyyyyy13044232222
18xxxxxxyyyyyy12222
19xxxxxxyyyyyy12222
Sheet1
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
It's not clear (at least to me) how the 6 you're looking to count is calculated...maybe you can walk us through that?
 
Upvote 0
Thanks, I will try and give some clarification. I am trying to count rows that have the same number throughout. If a row has a single value then I want that in the count. We are trying to count how many students start and end up in the same place after x amount of years.
 
Upvote 0
What if the starting and ending value are the same, but the middle numbers are different?
 
Upvote 0
Then that is not included in the count. It has to be all the same values in the row.
 
Upvote 0
Until someone smarter than me comes up with one formula to do it, it's easy enough with a helper column:

L2 =--(COUNTIF(E2:J2,MAX(E2:J2))=COUNTA(E2:J2)) copied down
M1 =SUM(L:L) gives your total
 
Upvote 0
Hi Stephen

Try:

=SUM(--(MMULT((E2:I19<>"")*(F2:J19<>"")*(F2:J19<>E2:I19),TRANSPOSE(--(COLUMN(E2:I2)>0)))=0))
entered with CSE.

The result is, however, 7 and not 6. The difference is that it's counting row 5, that has only a value 45. Did you not consider it by mistake or am I missing something?
 
Upvote 0
pgc01,

Thanks so much. You are right, it seems that row 5 has a value of 45 which you are right it should be 7. On my original sheet I had 45 and 46 in that row I don't know why the HTML maker did not show it, oh well.

Thanks again it works perfectly!
 
Upvote 0

Forum statistics

Threads
1,214,787
Messages
6,121,558
Members
449,038
Latest member
Guest1337

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