COUNTIFS Question...

Aitch

Board Regular
Joined
Jan 27, 2019
Messages
119
Office Version
  1. 2010
Platform
  1. Windows
How can I count the number of rows which all have the same name?
- so columns B,C,D,E are all equal so the result below would be 2

I've tried a bunch of COUNTIFS variations - but no luck!

Thanks for any help!

A​
B​
C​
D​
E​
F​
2
TomJoeJoe
PeteJohnBobTom
TomTomTomTom
BobBobJoeJoe
PeteTomTomJohn
JoeJoeJoeJoe
BobJoeJohnJack
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
T202012a.xlsm
ABCDE
1FALSETomJoeJoe
2TRUETomTomTomTom
3TRUETomTomTomTom
4FALSETomTomTom
5FALSETomJoeJoe
6FALSETomJoeJoe
7
822
5b
Cell Formulas
RangeFormula
A1:A6A1=COUNTIF(B1:E1,B1)=4
A8A8=COUNTIF(A1:A6,TRUE)
B8B8=SUMPRODUCT(--(B1:B6=C1:C6),--(B1:B6=D1:D6),--(B1:B6=E1:E6))
 
Last edited:
Upvote 0
Chaining the ranges like this appears to work
Book1
ABCDE
12TomJoeJoe
2PeteJohnBobTom
3TomTomTomTom
4BobBobJoeJoe
5PeteTomTomJohn
6JoeJoeJoeJoe
7BobJoeJohnJack
Sheet5
Cell Formulas
RangeFormula
A1A1=SUMPRODUCT(COUNTIFS(B1:B7,C1:C7,C1:C7,D1:D7,D1:D7,E1:E7))
 
Upvote 0
How can I count the number of rows which all have the same name?
- so columns B,C,D,E are all equal so the result below would be 2

I've tried a bunch of COUNTIFS variations - but no luck!

Thanks for any help!

A​
B​
C​
D​
E​
F​
2
TomJoeJoe
PeteJohnBobTom
TomTomTomTom
PeteTomTomJohn
JoeJoeJoeJoe
BobJoeJohnJack

Great, thanks!

Is there a way to ignore rows which all have blank cells - like row 4 above
 
Upvote 0
I assume formulas in those cells as a row with all empty cells would not be counted. The additional wildcard criteria pair in this version will look for cells with a length of at least one character.
Excel Formula:
=SUMPRODUCT(COUNTIFS(B1:B7,"?*",B1:B7,C1:C7,C1:C7,D1:D7,D1:D7,E1:E7))
 
Upvote 0
I may not be thinking clearly this morning.
I am using my laptop with Excel 2010.
Why is the test for a blank row necessary?
Why does my suggestion evaluate differently with the second example?

T202012a.xlsm
ABCDEFGHIJ
12TomJoeJoerows with same Text
2FALSEPeteJohnBobTom2
3TRUETomTomTomTom2Why is the test for a blank row necessary?
4FALSE
5FALSETomTomJohn
6TRUEJoeJoeJoeJoe
7FALSEBobJoeJohnJack
82
9
10
11With Excel 2010, I get 5 (F13) versus 3 (G13)
12Cells evaluate to see J13:J14
13FALSETomJoeJoe53G13{0;1;1;0;0;1;0},{0;1;1;1;0;1;0},{0;1;1;1;0;1;0}
14TRUETomTomTomTomF13{0;0;2;2;0;0;1}
15TRUETomTomTomTom
16FALSETomTomTom
17FALSETomJoeJoe
18TRUEJoeJoeJoeJoe
19FALSETomJoeJoe
203
21
5b
Cell Formulas
RangeFormula
F2,F13F2=SUMPRODUCT(COUNTIFS(B1:B7,C1:C7,C1:C7,D1:D7,D1:D7,E1:E7))
F3F3=SUMPRODUCT(COUNTIFS(B1:B7,"?*",B1:B7,C1:C7,C1:C7,D1:D7,D1:D7,E1:E7))
A1A1=SUMPRODUCT(COUNTIFS(B1:B7,C1:C7,C1:C7,D1:D7,D1:D7,E1:E7))
A13:A19,A2:A7A2=COUNTIF(B2:E2,B2)=4
A8,A20A8=COUNTIF(A1:A7,TRUE)
G13G13=SUMPRODUCT(--(B13:B19=C13:C19),--(B13:B19=D13:D19),--(B13:B19=E13:E19))
 
Upvote 0

Forum statistics

Threads
1,214,921
Messages
6,122,280
Members
449,075
Latest member
staticfluids

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