+ Reply to Thread
Results 1 to 4 of 4

VLOOKUP - Return sum of all matches in Range?

  1. #1
    Registered User
    Join Date
    01-25-2007
    Posts
    4

    VLOOKUP - Return sum of all matches in Range?

    Hi,

    Is it possible (I'm sure it is - I simply don't know) to specify a vlookup to find ALL matches and return the sum of them?

    The issue we have is this current forumla (pasted below) looks for a corresponding cell, and then reads the adjacent value. However it stops after the first match....the first match has 0 in it. The issue is there are a further 2 instances of that 'matching' value....which has adjacent cells with positive values in.


    Current Formula: =IF(ISERROR(VLOOKUP(O14,'sheet1'!$B$4:$AG$1116,32,FALSE)),"0",VLOOKUP(O14,'sheet1'!$B$4:$AG$1116,32,FALSE))-K14+L14

    I understand what is happening - looking up an exact value (hence FALSE) ...if it's not found, it displays a "0"....if it is, it runs pulls the data from the first match.

    Please help somebody - this is haunting me

  2. #2
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    =sumif(sheet1!$b$4:$b$1116,O14,'sheet1'!$ag$4:$AG$1116)-K14+L14

    Regards

    Dav

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Or sumproduct would do

    http://www.xldynamic.com/source/xld.SUMPRODUCT.html


    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Registered User
    Join Date
    01-25-2007
    Posts
    4
    Thanks guys - did the trick.

    For some reason I was stuck on the VLOOKUP function - didn't think to look elsewhere

+ 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