1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: vlookup and sumif in Excel

Discussion in 'Business Applications' started by deastew, Feb 27, 2013.

Thread Status:
Not open for further replies.
Advertisement
  1. deastew

    deastew Thread Starter

    Joined:
    Dec 5, 2012
    Messages:
    14
    I would like to create a formula that sums the value in column B for each time the number in column A appears. In essence, I want a formula to return numbers in column D. I tried using the following formula but it did not work:

    =SUMIF(A2:A9,VLOOKUP(C2,A:B,2,FALSE),B2:B9)

    Column A Column B Column C Column D
    991 0 991 2
    992 1 992 4
    993 0 993 0
    994 5 994 7
    991 2
    992 3
    993 0
    994 2

    Please help!

    Thanks
     
  2. etaf

    etaf Moderator

    Joined:
    Oct 2, 2003
    Messages:
    65,184
    First Name:
    Wayne
    in c2 put
    Code:
    =IF(OR(INDEX($A$2:$A$10,MATCH(0,INDEX(COUNTIF($C$1:C1,$A$2:$A$10),0,0),0))=0,ISERROR(INDEX($A$2:$A$10,MATCH(0,INDEX(COUNTIF($C$1:C1,$A$2:$A$10),0,0),0)))),"",INDEX($A$2:$A$10,MATCH(0,INDEX(COUNTIF($C$1:C1,$A$2:$A$10),0,0),0)))
    
    and copy down
    in D2 put
    Code:
    =IF(C2="","",SUMIF(A2:A9,C2,B2:B9))
    see attached
     

    Attached Files:

  3. deastew

    deastew Thread Starter

    Joined:
    Dec 5, 2012
    Messages:
    14
    Thank you so much!!! It worked! :)
     
  4. etaf

    etaf Moderator

    Joined:
    Oct 2, 2003
    Messages:
    65,184
    First Name:
    Wayne
    your welcome (y)
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1091228

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice