+ Reply to Thread
Results 1 to 14 of 14

SUM formula with XLOOKUP with multiple arrays

  1. #1
    Registered User
    Join Date
    11-18-2022
    Location
    London
    MS-Off Ver
    O365
    Posts
    34

    SUM formula with XLOOKUP with multiple arrays

    Hi All

    Hopefully this makes sense but I'm trying to create a rolled up view of live data which is extracted from multiple workbooks located in different Sharepoint areas (These can not be moved hence why I thought the 'Get Data' option would not be viable), however the format of these workbooks are all the same as these are from one template.

    In the Summary workbook, I'm trying to SUM the totals for each month forecast and actuals from the Template workbook. This is the formula I have created so far but this is pulling incorrect data for my actuals as per the spreadsheet attached. I have added some values in the Template workbook for March & April 24 Forecast and Actuals and the results in the Summary workbook to show what I should expect but only getting the Forecast values correctly. I believe I need to include in this formula the array of either "Forecast" or "Actuals" unless there is a better option which I'm happy to utilise.

    =SUM(XLOOKUP(D2,'path file[Template.xlsx]External Budget'!$M$17:$AJ$17,'path file[Template.xlsx]External Budget'!$M$29:$AJ$29)+XLOOKUP(D2,'path file[Template.xlsx]External Budget'!$M$32:$AJ$32,'path file[Template.xlsx]External Budget'!$M$44:$AJ$44))

    Please do reach out if this does make sense or need more info.

    Thanks in advance
    Last edited by Monsta92; 01-12-2024 at 05:26 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,209

    Re: SUM formula with XLOOKUP with multiple arrays

    For the purposes of assisting you, it would be so much easier for your helpers if you combined the two workbooks as tabs in one workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    11-18-2022
    Location
    London
    MS-Off Ver
    O365
    Posts
    34

    Re: SUM formula with XLOOKUP with multiple arrays

    Hi Ali

    I thought it would be beneficial to separate these so helpers can understand that these are not from the same workbook but different workbooks located elsewhere.

    If you think this would be much easier to assist in, then I'm happy to separate these.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,209

    Re: SUM formula with XLOOKUP with multiple arrays

    It is enough to SAY that they are in two separate workbooks. However, for speed of assistance, a combined workbook in addition would help.

    It's up to you - I'll have a look if you provide a combined version. Leave the uncombined ones there as well.

  5. #5
    Registered User
    Join Date
    11-18-2022
    Location
    London
    MS-Off Ver
    O365
    Posts
    34

    Re: SUM formula with XLOOKUP with multiple arrays

    Hi Ali

    I have now combined these and appreciate you looking into this

    Just to note, I have removed the "=" from the formula to replace the actual file path to the wording "file path" as this did contain sensitive information of where these are stored.
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,209

    Re: SUM formula with XLOOKUP with multiple arrays

    You've also removed the original files - I told you to leave them attached.

    You also need to fix the links in the combined wrokbook to work with the other tab in the workbook. The idea is to make it as easy as you can for your helper (who is not being paid, by the way).

    I'll have a look when you've got it all fixed.

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,015

    Re: SUM formula with XLOOKUP with multiple arrays

    I'd still use Get Data to consolidate all the data into a table in the summary workbook, then run your formulas off that.
    Everyone who confuses correlation and causation ends up dead.

  8. #8
    Registered User
    Join Date
    11-18-2022
    Location
    London
    MS-Off Ver
    O365
    Posts
    34

    Re: SUM formula with XLOOKUP with multiple arrays

    Sorry! Trying to multi task and failing miserably, should have read your message clearly to keep these in.

    I have now updated the Summary workbook to link to the Template sheet in this and also included the Template workbook back in.

    Once again, apologies and I do appreciate you looking into this.
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,043

    Re: SUM formula with XLOOKUP with multiple arrays

    Here is a formula that seems to do what you want:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    When the External Budget is moved to a separate workbook, the formula should update the references to that sheet to include the file path.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  10. #10
    Registered User
    Join Date
    11-18-2022
    Location
    London
    MS-Off Ver
    O365
    Posts
    34

    Re: SUM formula with XLOOKUP with multiple arrays

    That is brilliant! Works exactly as I needed, thank you!

  11. #11
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,043

    Re: SUM formula with XLOOKUP with multiple arrays

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

  12. #12
    Registered User
    Join Date
    11-18-2022
    Location
    London
    MS-Off Ver
    O365
    Posts
    34

    Re: SUM formula with XLOOKUP with multiple arrays

    In the workbook you have attached, the actuals are correct. However, when I replicate this in my own workbook after linking the path files only the forecast figures are correct and the actuals are 0 (even though there are actuals). Any idea why this might be?

    =IF(D$3="Forecast",SUM(SUMIFS('External Budget'!$M$29:$AI$29,'External Budget'!$M$17:$AI$17,D$2,'External Budget'!$M$18:$AI$18,"Forecast"),SUMIFS('External Budget'!$M$44:$AI$44,'External Budget'!$M$32:$AI$32,D$2,'External Budget'!$M$33:$AI$33,"Forecast")),SUM(SUMIFS('External Budget'!$N$29:$AJ$29,'External Budget'!$M$17:$AI$17,C$2,'External Budget'!$N$18:$AJ$18,"Actuals"),SUMIFS('External Budget'!$N$44:$AJ$44,'External Budget'!$M$32:$AI$32,C$2,'External Budget'!$N$33:$AJ$33,"Actuals")))

    Also, I was confused when replicating this formula why C$2 was relevant as a criteria as that cell relates to a table header labelled "Projects". This changes after January month which then refers to cells of previous months i.e. for February it relates to January

  13. #13
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,043

    Re: SUM formula with XLOOKUP with multiple arrays

    I can not replicate the issue. I moved the External Budget sheet into a new workbook, then closed the new workbook, and the formula worked.
    Without seeing a sample of your workbook that contains the External Budget sheet my thought is that "Actuals" in N18, P18 etc. may have an extra space behind the s.
    as to C$2, when you compare the formulas in cells D4 and E4 you will see that in cell D4 the value_if_true portion of the IF based formula is directed to the correct month-year.
    When the formula is dragged across from cell D4 to cell E4, C$2 becomes D$2 so the value_if_false portion of the formula is now directed to the correct month-year even though the value_if_true portion isn't. (I hope that makes sense)

  14. #14
    Registered User
    Join Date
    11-18-2022
    Location
    London
    MS-Off Ver
    O365
    Posts
    34

    Re: SUM formula with XLOOKUP with multiple arrays

    It was an issue on my part so apologies and once again thank you for your help!

+ 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. [SOLVED] Help with XLOOKUP formula with multiple criteria
    By Monsta92 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-02-2023, 11:26 AM
  2. [SOLVED] xlookup with arrays
    By guillaume0314 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-14-2023, 01:04 PM
  3. XLOOKUP to search two arrays and return one value?
    By Danlogo10 in forum Excel General
    Replies: 2
    Last Post: 01-20-2023, 05:44 PM
  4. [SOLVED] Xlookup or what formula? (with multiple column on lookup array)
    By Elainefish in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 04-27-2022, 05:04 AM
  5. Help on XLOOKUP formula with multiple criteria
    By lyzas in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-22-2021, 05:06 AM
  6. Multiple criteria for XLOOKUP formula
    By mikehk in forum Excel General
    Replies: 1
    Last Post: 06-28-2021, 05:50 PM
  7. Declaring multiple multi-dimensional arrays (jagged arrays) - compile error?
    By dfribush in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-20-2013, 05:06 PM

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