help needed to count instances?

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)
 
D

David M

I would create a pivot table,then format the field setting
to count the data in that row, then only show (H)....

Regards
 
G

Guest

using countif sums the total count of H,,,,I was hoping
that it would only count the appearances? ie in my example
2
 
F

Frank abel

Hi
o.k. try
=SUMPRODUCT(--(A1:I1="H"),--(B1:J1<>"H"))

Note the different starting points for both ranges
 
G

Guest

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

.
 
F

Frank Kabel

Hi
the double minus / unary coerces a boolean value to a number
(TRUE=1,FALSE=0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top