help needed to count instances?

  • Thread starter Thread starter Gerry
  • Start date Start date
G

Gerry

Does anyone know how to count 'instances' across a row.
ie.
in a1 to c1 might contain H.
d1 to f1 might contain b
g1 to i1 might contain H.
I need to calculate the number of times h appears (=2)
 
I would create a pivot table,then format the field setting
to count the data in that row, then only show (H)....

Regards
 
using countif sums the total count of H,,,,I was hoping
that it would only count the appearances? ie in my example
2
 
Hi
o.k. try
=SUMPRODUCT(--(A1:I1="H"),--(B1:J1<>"H"))

Note the different starting points for both ranges
 
THANKS...it seems to work...what does the (--( do?
-----Original Message-----
Hi
o.k. try
=SUMPRODUCT(--(A1:I1="H"),--(B1:J1<>"H"))

Note the different starting points for both ranges

.
 
Back
Top