Nested --- Subtotal IF function

L

Lisa Beach

How do I do this?

I'm using autofilter to hide rows that = 0.
to get the total I have
Subtotal (9, D2:D50)

Now I need to count if column A = A1
COUNTIF(A2:A50, A1)

The only problem w/ the above is that it counts the hidden rows. How do I
count only the visible rows?

Thanks in advance.

Lisa
 
B

Bob Phillips

=SUMPRODUCT(($A$2:$A$50=A1)*(SUBTOTAL(9,OFFSET($D$1,ROW($D$2:$D$50)-ROWS($D$
1),,1))))

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
B

Bob Phillips

Sorry, to count use

=SUMPRODUCT(($A$2:$A$50=A1)*(SUBTOTAL(3,OFFSET($D$1,ROW($D$2:$D$50)-ROWS($D$
1),,1))))

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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