+ Reply to Thread
Results 1 to 14 of 14

sum VLOOKUPs (not cells)

  1. #1
    Registered User
    Join Date
    08-12-2009
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    7

    sum VLOOKUPs (not cells)

    Hey!
    I have a list of cells and for each of them I preform VLOOKUP in a certain table.
    Now, I want to sum the values all the VLOOKUPs without viewing the results of each VLOOKUP. In other words, I don't want a cell for each VLOOKUP result. I am only interested in their sum.

    Is there a way to do this?

    Thanks in advance.
    Last edited by sgdled; 08-12-2009 at 09:50 AM. Reason: solved

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,054

    Re: sum VLOOKUPs (not cells)

    =sum(vlookup1, vlookup2...)
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    08-12-2009
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: sum VLOOKUPs (not cells)

    Quote Originally Posted by zbor View Post
    =sum(vlookup1, vlookup2...)
    Yes, but suppose I have 100 VLOOKUPs, I don't want to manually write the 100 VLOOKUPs. I want to only specify a range and on that range it will preform VLOOKUP and then sum the results.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: sum VLOOKUPs (not cells)

    what exactly do you mean? 100's of vlookups?
    if you vlookup on a range you only get one result any way
    do you mean for every cell in range that contains ,say ,"cash" sum its corresponding value?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    08-12-2009
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: sum VLOOKUPs (not cells)

    Quote Originally Posted by martindwilson View Post
    what exactly do you mean? 100's of vlookups?
    if you vlookup on a range you only get one result any way
    do you mean for every cell in range that contains ,say ,"cash" sum its corresponding value?
    No. I mean, I have 100 different elements. Each of those elements I want to lookup in the table and return a value. Then I want to sum all of the 100 returned values. (All this without the returned values appearing in cells)

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: sum VLOOKUPs (not cells)

    And so the next questions would be ... where are you 100 values stored and what is the range that contains the values of interest (ie those to be summed) ?

  7. #7
    Registered User
    Join Date
    08-12-2009
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: sum VLOOKUPs (not cells)

    Quote Originally Posted by DonkeyOte View Post
    And so the next questions would be ... where are you 100 values stored and what is the range that contains the values of interest (ie those to be summed) ?
    Well, my question is actually can I calculate the sum without storing the 100 values returned by VLOOKUP. I would like to do something like this:
    Please Login or Register  to view this content.
    But use a sort of sum function instead of writing such a long line...

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: sum VLOOKUPs (not cells)

    No, my point was more you have 100 values to look for, where are they ?

    Based off your prior formula example they are seemingly stored in A1:A100, appearing in column 1 of named range with values in column 2 of named range, in which case the below should work:

    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: sum VLOOKUPs (not cells)

    The reason, sgdled, that you're getting these questions-instead-of-answers, is because your data seems to be arranged in quite a peculiar way (from what I can tell) and the natural response of the contributors here is to try to "make things better" - it's more like consultancy than robotics, if that makes sense. There's a good chance you will save a lot of time be organising the spreadsheet differently a few steps further back up the chain.

    CC

  10. #10
    Registered User
    Join Date
    08-12-2009
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: sum VLOOKUPs (not cells)

    Quote Originally Posted by DonkeyOte View Post
    No, my point was more you have 100 values to look for, where are they ?

    Based off your prior formula example they are seemingly stored in A1:A100, appearing in column 1 of named range with values in column 2 of named range, in which case the below should work:

    Please Login or Register  to view this content.
    This is very close to what I want. However, there is still a problem if I have multiple entries in A1:A100. This formula, will count only one of them.

  11. #11
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: sum VLOOKUPs (not cells)

    Not sure I understand ... you're saying if A1:A100 contain the same value twice the result should be duplicated ? ie

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    08-12-2009
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: sum VLOOKUPs (not cells)

    Quote Originally Posted by DonkeyOte View Post
    Not sure I understand ... you're saying if A1:A100 contain the same value twice the result should be duplicated ? ie

    Please Login or Register  to view this content.
    Thanks DonkeyOte!
    One more thing. Let's say I now want to calculate the following sum:
    Please Login or Register  to view this content.
    In other words, sumproduct between the values found in DataTable for A1:A100 and B1:B100.
    Is that possible?

  13. #13
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: sum VLOOKUPs (not cells)

    Probably easier to revert to a traditional Array, eg:

    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    08-12-2009
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: sum VLOOKUPs (not cells)

    Quote Originally Posted by DonkeyOte View Post
    Probably easier to revert to a traditional Array, eg:

    Please Login or Register  to view this content.
    Wow, thank you DonkeyOte!!
    You are a true genius

+ 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