+ Reply to Thread
Results 1 to 15 of 15

Vlookup multiple values in a range and sum

  1. #1
    Registered User
    Join Date
    02-01-2011
    Location
    Philadelphia, Pennsylvania
    MS-Off Ver
    Excel 2007
    Posts
    57

    Vlookup multiple values in a range and sum

    Hi all,
    i've looked around and havent been able to solve this problem so far, maybe you guys can help.
    i have a set of data in which i'm trying to lookup a value from a range of file #'s (ex 100-125) that i have concatenated with a file ID (ex 123456789). as of right now i have to vlookup each individual concatenated number, return the result value in its own column (one for 100, one for 101 and so on..) and then sum all 25 columns to get the final number) is there a way to vlookup the range (ID+100:125) and sum the results?

    here's the formula i use for each column starting with 100, A2 representing the file ID, C:O being the array

    =IF(ISERROR(VLOOKUP(A2&100,$C$2:$O$10000,13,FALSE)),"0.00",VLOOKUP(A2&100,$C$2:$O$10000,13,FALSE))

    any help or direction is much appreciated!

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Vlookup multiple values in a range and sum

    Any chance you would be able to upload a spreadsheet (with any sensitive/identifiable data removed/changed)?

  3. #3
    Registered User
    Join Date
    02-01-2011
    Location
    Philadelphia, Pennsylvania
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Vlookup multiple values in a range and sum

    sure here you go, i've removed some sensitive info, also instead of 100-125 (example i used earlier) i've completed a couple columns starting with 1501, thanks!
    Attached Files Attached Files
    Last edited by kboy1289; 12-06-2013 at 12:01 PM.

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Vlookup multiple values in a range and sum

    Maybe..

    In Row 2

    =SUMIF(E:E,A2&"*",O:O)

    Copy down
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  5. #5
    Registered User
    Join Date
    02-01-2011
    Location
    Philadelphia, Pennsylvania
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Vlookup multiple values in a range and sum

    hm that didnt seem to work. the E:E should be switched to C:C also (column e is concatenated for a different set of values which i'll apply to whatever the solution is and it has an extra 0) i would hope it some complicated string i've also tried =IF(ISERROR(VLOOKUP(A2&{1501,1502,1503,1504}$C$2:$O$9803,13,FALSE)),"0.00",VLOOKUP(A2&{1501,1502,1503,1504},$C$2:$O$9803,13,FALSE))

  6. #6
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Vlookup multiple values in a range and sum

    My bad..try..

    =SUMIF(C:C,A2&"*",O:O)

  7. #7
    Registered User
    Join Date
    02-01-2011
    Location
    Philadelphia, Pennsylvania
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Vlookup multiple values in a range and sum

    it looks like its adding other File#'s just want it to capture from a range of say 1501-1525. its capturing everything associated with that ID below 1501 want to exclude everything below that. its close though.

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

    Re: Vlookup multiple values in a range and sum

    maybe in p2
    =SUMIF($C$2:$C$1000,$A2&P$1,$O$2:$O$1000)
    "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

  9. #9
    Registered User
    Join Date
    02-01-2011
    Location
    Philadelphia, Pennsylvania
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Vlookup multiple values in a range and sum

    that works for 1501 because P1 is labeled as such, what about file #'s 1502-1525 how do i include them in the sum?

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

    Re: Vlookup multiple values in a range and sum

    the way you have that table laid out thats what i thought you meant

  11. #11
    Registered User
    Join Date
    02-01-2011
    Location
    Philadelphia, Pennsylvania
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Vlookup multiple values in a range and sum

    whoops sorry for the confusion. thats just showing you what i have now. my end result is to have all files #'s 1501-1525 sum in one cell based on a vlookup of the concatenated #. so imagine instead of 1501,1502,1503 columns etc just one column called 1500 series with the end sum calculated in one cell.

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

    Re: Vlookup multiple values in a range and sum

    so thats sum all values for say 3113080580XXXX
    that end in 1501,1502,1503,1504,..........,1525 ?

  13. #13
    Registered User
    Join Date
    02-01-2011
    Location
    Philadelphia, Pennsylvania
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Vlookup multiple values in a range and sum

    yes, thats exactly what im attempting to do!

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

    Re: Vlookup multiple values in a range and sum

    =SUMPRODUCT(--($A$2:$A$2000=A2),--(B2:B2000>=1501),--(B2:B2000<=1525),O2:O2000) any version of excel

    =SUMIFS(O2:O2000,$A$2:$A$2000,A2,B2:B2000,">="&1501,B2:B2000,"<="&1525) excel 2007 or later

  15. #15
    Registered User
    Join Date
    02-01-2011
    Location
    Philadelphia, Pennsylvania
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Vlookup multiple values in a range and sum

    yes, that's it! well add $ to B & O, but you nailed it. thanks man!

+ 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. Vlookup function to return multiple values from multiple sheets
    By bsamant in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-13-2013, 11:31 AM
  2. VLookup - Return multiple values in multiple cells HELP
    By sreeves1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-02-2012, 12:58 PM
  3. Replies: 6
    Last Post: 09-04-2012, 10:35 AM
  4. Replies: 6
    Last Post: 03-24-2011, 06:19 AM
  5. Is there anyway to use Vlookup for negative values or a range of values?
    By excelplshelp1 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-28-2008, 10:19 AM

Tags for this Thread

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