+ Reply to Thread
Results 1 to 16 of 16

SUM of Index/Match of multiple worksheets

  1. #1
    Registered User
    Join Date
    06-15-2021
    Location
    Australia
    MS-Off Ver
    Office365
    Posts
    6

    SUM of Index/Match of multiple worksheets

    Hi all, and thank you in advance for your kind reply.

    I am wondering if it is possible to SUM the looking up the results of Index Match from multiple worksheets?

    I have attached a basic example, and I use Office365.


    Some points to note:

    * The worksheets I am looking up and then totalling, will not always look the same, or be in the same formatting/order, so a simple 3D sum is not ideal, and thus was hoping to use an index match method, or other method you can recommend. The example attached the cells on each sheet are in different locations. Happy to use Arrays if you can provide some guidelines on how that might work in this example.

    * It is a simple workbook with multiple sheetnames, and I wish to sum up index/match onto a cover sheet.

    * I understand it can be done manually by INDEX/MATCH + INDEX/MATCH + INDEX/MATCH, however, there will be a large number of sheets, and I was hoping to sum up by a named range listing the worksheets, or to sum up in between worksheets (start/end), or sheet3 to sheet5 etc.


    I did try searching for some examples on the forums, but couldn't find anything that matched my request, so any assistance would be greatly appreciated.

    From my example.xlsx, Cell F6 on "Summary" sheet is a simple INDEX/MATCH of:
    =INDEX(Sheetname1!F:F,MATCH($C6,Sheetname1!$C:$C,0)) + INDEX(SheetnameABC!F:F,MATCH($C6,SheetnameABC!$C:$C,0)) + INDEX(SheetnameB2!F:F,MATCH($C6,SheetnameB2!$C:$C,0))

    I was hoping to shorten this formula, it only sums 3 sheets, but it could be 20+ sheets.
    The only data in this formula that would change is the worksheet name, otherwise all other data and column locations will be consistent, so I was hoping that sheet name can be dynamic.


    Thank you kindly.

    Kylie
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: SUM of Index/Match of multiple worksheets

    Personally I'd use a simple macro to create a single sheet database from all the sheets and then use a Pivot Table or regular functions to summarise from the database.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,416

    Re: SUM of Index/Match of multiple worksheets

    TRY
    worksheet name : Summary
    Cell F6 formula , Drag down and accross

    HTML Code: 

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,199

    Re: SUM of Index/Match of multiple worksheets

    Why multiple sheets when the format is the same (reference Richard's reply in post#2)?

  5. #5
    Registered User
    Join Date
    06-15-2021
    Location
    Australia
    MS-Off Ver
    Office365
    Posts
    6

    Re: SUM of Index/Match of multiple worksheets

    Hi wk9128, thank you, that did work, and its a lot more elegant that what I had, so appreciate that.

    Do you know if I can replace "Sheetname1","SheetnameABC","SheetnameB2" in your formula to some kind of named range? This would shorten this a lot, and then I think that has solved my problem.
    Or are you aware if instead of a named range, we could swap that to name all sheets "in between" sheets "Start" and "End" (or in between Sheets2 and Sheets6?

    If not further update to your reply, you still made mine much better, so again, appreciate that.

  6. #6
    Registered User
    Join Date
    06-15-2021
    Location
    Australia
    MS-Off Ver
    Office365
    Posts
    6

    Re: SUM of Index/Match of multiple worksheets

    Hi JohnTopley/Richard. Thank you for your reply. The sheets will actually be different, its just in my example they appeared to be the same. I tried to show they were different by moving the rows around on each sheet. Probably should have deleted some fields.

    The only constant would be the columns will be consistent on each sheet, but rows and item numbers will vary.

  7. #7
    Registered User
    Join Date
    06-15-2021
    Location
    Australia
    MS-Off Ver
    Office365
    Posts
    6

    Re: SUM of Index/Match of multiple worksheets

    Great suggestion Richard. I had initially thought about a pivot table which would have made my life a bit easier, I am just using this example xlsx to find a way to sum lookups on various sheets, but the final result of the workbook will look completely different. This is just the one formula or task I am a bit stuck on. Without going into all the details, the final sheet (lets call it a cover) will have various versions for different stakeholders, and I am trying to appease the needs of the many as those people arent versed in pivot tables or getting data easily.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,199

    Re: SUM of Index/Match of multiple worksheets

    If the columns are consistent then I am not sure of the "problem" as rows are (almost) always different values. It is easier to 2select2 from a single sheet rather than combine from multiple sheets

    And with INDIRECT you can use a named range containing your sheet names.

  9. #9
    Registered User
    Join Date
    06-15-2021
    Location
    Australia
    MS-Off Ver
    Office365
    Posts
    6

    Re: SUM of Index/Match of multiple worksheets

    Quote Originally Posted by JohnTopley View Post
    If the columns are consistent then I am not sure of the "problem" as rows are (almost) always different values. It is easier to 2select2 from a single sheet rather than combine from multiple sheets

    And with INDIRECT you can use a named range containing your sheet names.


    Thanks JohnTopley.

    I do need to have those sheets on individual sheets rather than combined, as they will be viewed and updated by individual people from another business unit/organisation. Those people who update sheet A are not permitted to see sheet B or C or the summary sheet as an example. Having a single sheet would have confidentially issues for the person to update it. So ideally I would like them to update a worksheet they do in their own time and sent it through so I either bring their file in by inserting as a sheet or copy pasting. I guess there are multiple ways to do this from people who are much more knowledgeable about best practice than I.
    Last edited by kyliemanuel; 06-15-2021 at 08:27 AM. Reason: Wrong spelling of persons name

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,199

    Re: SUM of Index/Match of multiple worksheets

    I understand the confidentiality issue but it still might worth looking a Richard's suggestion of combining into a "summary" using VBA (and VBA is not always an option because of company policy not to use it).

    Enough said!

  11. #11
    Registered User
    Join Date
    06-15-2021
    Location
    Australia
    MS-Off Ver
    Office365
    Posts
    6

    Re: SUM of Index/Match of multiple worksheets

    Quote Originally Posted by wk9128 View Post
    TRY
    worksheet name : Summary
    Cell F6 formula , Drag down and accross

    HTML Code: 

    Hi wk9128, thank you for your reply on the formula. When I replied to this, I forgot to use "reply with quote" option. So I've just redone this.

    Is it possible to change the names of the Sheets to a named range, or other method you can recommend (ie sheet names in a cell). If it were a named ranged or other method, could you modify the formula you provided to give me something to play with? This refers to sheet string from your formula - "Sheetname1","SheetnameABC","SheetnameB2"

    Thank you. Kylie

  12. #12
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,416

    Re: SUM of Index/Match of multiple worksheets

    The name of your worksheet has been changed to 1, 2, 3, please refer to it
    G18 and I18 are changed, there will be statistics for different months
    Attached Files Attached Files

  13. #13
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: SUM of Index/Match of multiple worksheets

    Quote Originally Posted by kyliemanuel View Post
    Thanks JohnTopley.

    I do need to have those sheets on individual sheets rather than combined, as they will be viewed and updated by individual people from another business unit/organisation. .
    That still doesn't preclude you from having a macro which you'd run every time you wanted a management summary. The macro would delete all the previous summary and refresh the database. It could be on a hidden sheet if necessary, the users don't even need to know it's there.
    What you currently show as a summary sheet could be created at run time from the database the macro produces and all done without any functions.

  14. #14
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: SUM of Index/Match of multiple worksheets

    Just out of interest how do the 6 different Headings (Heading A, Heading B, Category A..etc) across all sheets end up as just two 'blocks' on the summary.

    I can see that the summary is by customer, but why does the summary group the vendors in just two blocks in the way it does?

    For instance Vendor A exists within Heading B on Sheetname1, under Category A on Sheetname ABC, and under Another Heading D on Sheetname B2

  15. #15
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: SUM of Index/Match of multiple worksheets

    Here's an example of the sheet summarisation I mentioned. KIt doesn't address the earlier point about how the vendors are split into blocks but when that's known no doubt this could be adopted.

    It uses the following two macros. One for summarising the sheets and the other for clearing the summary.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  16. #16
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: SUM of Index/Match of multiple worksheets

    I quite like complex formulae!!

    So.... an alternative, using an old inbuilt Excel 4.0 macro to assist in returning a dynamic list of sheet names. You can do this manually and save as an .xlsx, but this will do it for you... as an .xlsm

    Two Named ranges (CTRL F3 to view/edit):

    Sheets:
    =TRANSPOSE(GET.WORKBOOK(1))&T(NOW())

    Dynamic:
    =INDEX(Summary!$X:$X,AGGREGATE(15,6,ROW(Summary!$X$2:INDEX(Summary!$X:$X,COUNTIF(Summary!$X:$X,"<>")))/(LEN(Summary!$X$2:INDEX(Summary!$X:$X,COUNTIF(Summary!$X:$X,"<>")))>0),ROW(Summary!$X$1:INDEX(Summary!$X:$X,ROWS(Summary!$X:$X)*COLUMNS(Summary!$X:$X)-COUNTBLANK(Summary!$X:$X)-ROW(Summary!$X$1)))))

    Then in Summary X2, copied down:
    =IFERROR(INDEX(MID(Sheets,FIND("]",Sheets)+1,255),SMALL(IF(MID(Sheets,FIND("]",Sheets)+1,255)<>MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255),ROW(INDIRECT("$A$1:$A$"&COUNTA(MID(Sheets,FIND("]",Sheets)+1,255))))),ROW(1:1)),1),"")

    and in Summary F2, copied across and dnown:
    =IFERROR(1/(1/SUMPRODUCT(SUMIF(INDIRECT("'"&Dynamic&"'!C6:C100"),$C6,INDIRECT("'"&Dynamic&"'!"&CELL("address",F$6)&":"&CELL("address",F$100))))),"")
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

+ 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. INDEX/MATCH using multiple worksheets where index is aplhanumeric
    By USAOz in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-10-2020, 06:03 AM
  2. Replies: 1
    Last Post: 08-22-2020, 04:47 PM
  3. Index Match with multiple worksheets
    By Angry Alex in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-12-2015, 05:34 AM
  4. INDEX and MATCH multiple worksheets
    By bluefiesta in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-30-2014, 03:17 PM
  5. Index and Match across multiple worksheets
    By GTHORE in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 02-09-2013, 01:05 PM
  6. Index match multiple worksheets
    By rrivera616 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-28-2013, 07:03 PM
  7. Excel 2007 : Index and Match using multiple worksheets
    By lola12345 in forum Excel General
    Replies: 1
    Last Post: 10-27-2011, 03:31 PM

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