+ Reply to Thread
Results 1 to 4 of 4

Vlookup + sumif

  1. #1
    Registered User
    Join Date
    10-24-2012
    Location
    Niteroi, Rio de janeiro
    MS-Off Ver
    Excel 2010
    Posts
    4

    Vlookup + sumif

    I work at a retail company and I am having trouble creating a new worksheet that shows the information that I need!

    There are 2 worksheets:
    1- Summary
    2- Sales

    Here is what I have right now! I'm currently using this formula: =IFERROR(VLOOKUP(A2,Sales!$A$2:$D$5,3,0),0)

    Summary:
    Name Code Total Sold Stock
    product1 12345 20 100
    Product2 12410 0 100
    product3 12222 30 100
    product4 14123 40 100


    Sales:
    Name Code Sold Stock
    product1 12345 20 100
    product1 12345 10 100
    product3 12222 30 100
    product4 14123 40 100
    Product3 12222 20 100


    The problem with this is that on SUMMARY, the C Column is only returning the first value it encounters on the SALES worksheet. What I need for it to do is to SUM all the SOLD values according to the NAME column or the CODE column

    So, is it possible to use SUMIF and VLOOKUP together? If not, is there another option?

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,604

    Re: Vlookup + sumif

    Don't use VLOOKUP - it can only return a single matching value. Use this instead:

    =SUMIF(Sales!A:A,A2,Sales!C:C)

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    10-02-2012
    Location
    Baku
    MS-Off Ver
    Excel 2010
    Posts
    273

    Re: Vlookup + sumif

    =SUMIF(Sales!A:A,Summary!A2,Sales!C:C)

  4. #4
    Registered User
    Join Date
    10-24-2012
    Location
    Niteroi, Rio de janeiro
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Vlookup + sumif

    Thank you very much!
    This is EXACTLY what I was looking for!!

    You guys always seem to amaze me with your fast responses! )

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1