Formula Help - If and Subtotal(???)

G

Guest

I am looking for formula help. I have a list of "Names" in Cells A1:A15
(e.g. A1=John, A2=Jane, A3=John, A4=Fred, A5=John…). In Column B, I have a
list of numbers in Cells B1:B15 (e.g. B1=1,B2=2,B3=3,B4=5,B5=5,...). I would
like to set up a formula in Column C where I indicate that IF Column A
contains John, then sum the numbers in Column B that are adjacent to John's
name. So in my example, there are three instances of "John." The numbers
adjacent to John's name total 9 (1+3+5). Is there a formula for this. My
guess is a subtotal or sumif formula nested inside an IF formula but I could
be mistaken. Everything I tried so far does not work.
 
G

Guest

Look into the SumIf function, will let you specify thename to look for and
add what is in the column by them.
 
P

Peo Sjoblom

=IF(COUNTIF(A1:A15,"John")>0,SUMIF(A1:A15,"John",B1:B15),"no John")

I would personally use


=SUMIF(A1:A15,D1,B1:B15)

and put the names in D1



--


Regards,


Peo Sjoblom
 
B

Bob Phillips

=SUMIF(A:A,"John",B:B)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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

Similar Threads


Top