Adding digits in a column based on data in a separate column

A

adriver

I am making a log for incoming documents, and need to add the number of days
each type of document takes to be processed. Example:

Task Type Days to Complete
Type AA 10
Type AA 12
Type BB 6
Type CC 10
Type AA 8

Is there a way to count how many total days all "Type AA" documents took?
I've been trying COUNTIF variations and I can't get anything working.

THanks!
 
R

RagDyer

From your example and question, it looks like you want Sumif() instead of
Countif().

=Sumif(A2:A6,"Type AA",B2:B6)
 
M

Mike

Assuming your AA = in Column =A, and Num of Days is in Column B.
=SUMPRODUCT(--(A1:A5="AA")*(B1:B5))
 
A

adriver

Brilliant! I've never seen SUMPRODUCT before, but I dare say my life just
got a lot easier. Thanks!
 
J

JLatham

SUMPRODUCT() is really great when you need to total things up by multiple
criteria. For example, lets say you had another column that held the
initials of the person doing one of the tasks:
Task Type Days to Complete Employee
Type AA 10 RJ
Type AA 12 JB
Type BB 6 JB
Type CC 10 RJ
Type AA 8 RJ
you could find out how many days to complete task AA for RJ:
=SUMPRODUCT(--($A$1:$A$5="Type AA"),--($C$1:$C$5="RJ"),($B$1:$B$5))
But when only one condition is needed for testing (as in your original
request), the solution that RagDyer provided using SUMIF() is more efficient.
 

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