+ Reply to Thread
Results 1 to 9 of 9

VLOOKUP, 2 lookup values; then sum the lookup returned

  1. #1
    Registered User
    Join Date
    02-22-2012
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    13

    VLOOKUP, 2 lookup values; then sum the lookup returned

    Group, thank you in advance for the assistance.
    Please see attached file.

    I want to conduct a vlookup based on two lookup values. The table I am performing the lookup on may have multiple rows that match the criteria. I want the Sales Volume sum of all applicable rows.
    I see many formulas that reference all cells in a table, let's say $G$2:$J$25. How can I write this formula where data will be added to the table via a source data refresh without having to adjust the formula. That is one reason I liked the vlookup, because it will search the entire column.

    I am attempting to build the formula in C2:C11, lookup column A and B info in the table starting in G.

    Thank you,
    Price
    Multile vlookup values Then Sum-Example.xlsx
    Thank you for the assistance!

  2. #2
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: VLOOKUP, 2 lookup values; then sum the lookup returned

    Hello Price,

    Since you are eon Excel 2007, you can use SUMIFS

    =SUMIFS(J:J,G:G,A2,H:H,B2)
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: VLOOKUP, 2 lookup values; then sum the lookup returned

    Not VLOOKUP, SUMIFS:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: VLOOKUP, 2 lookup values; then sum the lookup returned

    I should point out that the Table does not need to refer to the whole columns, just the rows where you have data.


    Regards, TMS

  5. #5
    Registered User
    Join Date
    02-22-2012
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: VLOOKUP, 2 lookup values; then sum the lookup returned

    Thanks to the both of you for the responses, I can't seem to get the formula to work.
    Do you mind utilizing it in the spreadsheet, or writing it out with an explanation for each portion of the formula.

    @TMS: I was wanting it to refer to the entire column instead of just the rows of data so that I won't have to adjust the formula as more data is added.

  6. #6
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: VLOOKUP, 2 lookup values; then sum the lookup returned

    As Mr TMS mentioned u don't need to adjust the ranges if you ref a table, but for normal ranges u could use

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Click just below left if it helps, Boo?ath?

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: VLOOKUP, 2 lookup values; then sum the lookup returned

    I was wanting it to refer to the entire column instead of just the rows of data so that I won't have to adjust the formula as more data is added.
    It's a Structured Table. If you use Structured Table References, as I have in the formula provided, you don't need to worry about it ... Excel will maintain the table and the associated Named Range. Just entering a value in the row below the table will include the row in the Table.

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Making the Table include whole columns is likely to make the whole workbook slower calculating.


    If you don't want to use the functionality built into structured tables, you could create a Dynamic Named Range, or simply refer to the columns in the table.


    See the attached example

    Regards, TMS

  8. #8
    Registered User
    Join Date
    02-22-2012
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: VLOOKUP, 2 lookup values; then sum the lookup returned

    When I read TMS's "I should point out that the Table does not need to refer to the whole columns, just the rows where you have data." I must have misinterpreted this statement. I am familiar with table references, I use them regularly and my mind must have been elsewhere when I read this.

    Oh, and I found that I was attempting to utilize SUMIF instead of SUMIFS. That is more than likely when my mind wondered. Oops..

    In other news, do you know how I could then incorporate (for an additional column) a moving average of last three months.
    I found =AVERAGE(OFFSET(ref,COUNT(ref:ref)-3,0,3,1)) but struggling to incorporate into our formula.

    I want to use the SUMIFs then complete calculation to return last 3 months moving average. I added some months to the data and reattached, is it a problem that it is formatted as text?

    Revised_Multile vlookup values Then Sum-Example TMS.xlsx

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: VLOOKUP, 2 lookup values; then sum the lookup returned

    In other news, do you know how I could then incorporate (for an additional column) a moving average of last three months.
    Strictly speaking, your original question has been answered and this constitutes scope creep.

    You would do better to start a new thread for the new question to generate new interest.

    Regards, TMS



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Multiple Values returned in a lookup
    By Droopy23 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-23-2013, 03:19 PM
  2. Using approximate lookup and getting duplicate returned values
    By nikkigotro in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-16-2013, 02:54 PM
  3. Duplicate values returned using Index Match Lookup with Small()
    By jacob@thepenpoint in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-18-2013, 10:48 AM
  4. How to get greater than value returned in lookup or vlookup?
    By RONCONWAY@COMCAST in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 03-19-2012, 02:29 PM
  5. Lookup row for value and sum returned values.
    By TypeR in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-11-2007, 07:16 AM

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