+ Reply to Thread
Results 1 to 6 of 6

VLOOKUP and SUM on Multiple Tabs

Hybrid View

  1. #1
    Registered User
    Join Date
    01-29-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    27

    VLOOKUP and SUM on Multiple Tabs

    I see the following formula floating around quite a bit:

    =SUM(VLOOKUP($A2,May!$A:$K,5,0),VLOOKUP(Sheet2!A2,June!A:K,5,0),+(VLOOKUP(Sheet2!A2,July!A:K,5,0)))

    What if you have too many tabs? For instance what if you need a tab for every day of the month?

    Is there a condensed version of this formula? Or would an array formula be the way to go?

    Thanks,

    J.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: VLOOKUP and SUM on Multiple Tabs

    Create a column of tabnames somewhere in the sheet, then go to insert|Name|Define and name the range, something like: TabNames

    Then apply formula:

    =VLOOKUP(A$2,INDIRECT("'"&INDEX(TabNames,MATCH(TRUE,COUNTIF(INDIRECT("'"&TabNames&"'!A1:A100"),A$2)>0,0))&"'!A1:K100"),5,0)

    Note that you can't/shouldn't use full column references, so adjust ranges to suit and then confirm with CTRL+SHIFT+ENTER not just ENTER.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    01-29-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: VLOOKUP and SUM on Multiple Tabs

    That works to a point, however it doesn't seem to sum the result from each of the tabs. Perhaps I've missed something. For instance on Tab - 1 the cell being referenced has 10.50 in it. On Tab - 2 that same cell has 4.95 etc etc, instead of summing each of the results from each of the tabs, its only giving me the result from Tab - 1.

    Here is the formula I used:

    VLOOKUP(A3,INDIRECT("'"&INDEX(Tabnames,MATCH(TRUE,COUNTIF(INDIRECT("'"&Tabnames&"'!A1:A100"),A3)> 0,0))&"'!A1:P100"),16,0)

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

    Re: VLOOKUP and SUM on Multiple Tabs

    To aggregate:

    =SUMPRODUCT(SUMIF(INDIRECT("'"&Tabnames&"'!A1:A00"),A3,INDIRECT("'"&TabNames&"'!E1:E100")))
    note the above is Volatile and Tabnames must contain only valid sheet names else error shall result

    (obviously given SUMIF it will aggregate should more than 1 record exist on any given sheet - unlike VLOOKUP which would retrieve only the first record)

  5. #5
    Registered User
    Join Date
    05-05-2016
    Location
    Richardson, TX
    MS-Off Ver
    2013
    Posts
    8

    Re: VLOOKUP and SUM on Multiple Tabs

    I have a similar situation, where I am trying to sum accross multiple tabs. I've used the sumproduct formula above, but result = #REF!

    Summary Tab: Column A = project Name
    1 tab for each employee: Column A = project name; Column J = hours
    On summary tab, I want to sum hours by project across all employee tabs

    TABNAMES is a Defined Name referencing all tab names in workbook


    My formula: =sumproduct(sumif(indirect("'"&TABNAMES&"'!A1:A30"),A3,indirect("'"&TABNAMES&"'!J1:J30")))

    What am I missing?

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,640

    Re: VLOOKUP and SUM on Multiple Tabs

    anne.king,
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Ben Van Johnson

+ 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