• IMPORTANT NOTICE: The Excelguru Help Forums will be permanently shut down on Friday, June 26, 2026.

    With AI taking a more prevalent role in answering user questions, the traffic to the Excelguru Help Forums has seen a sharp decrease in traffic over the past couple of years. We do not see this trend changing anytime in the near future. As such, continuing to run the forums is just no longer feasible, so we have made the difficult decision to close them down at the end of the month.

    We appreciate everyone who joined our forums to ask and answer questions over the past decade – and in particular – want to say a huge THANK YOU to the moderators and administrators who volunteered their time and expertise on a daily basis. You made the community what it was.

    NOTE: NEW USER ACCOUNTS CAN NO LONGER BE CREATED.

XLOOKUP with SUM and FILTER

Lawless83

New member
Joined
Apr 30, 2026
Messages
2
Reaction score
0
Points
1
Excel Version(s)
2603
Afternoon Everyone,

Will try get all the info needed on the first post for everyone.

I am creating a spreadsheet that tracks service intervals on tools based on production data. I want the toolroom to be able to put in a week number when they service a tool and then a formula will sum up the production totals from a different worksheet from anything after that week number to calculate when the next service is needed.

The production data sheet works on tool numbers in the A column, week numbers across the top row and the production data in the resulting table.

I want the formula to use the cell the toolroom put in the week number of service as a reference value, and then sum up all values for that tool AFTER the declared week number.

I think I will need to use a XLOOKUP, along with FILTER and SUM but just cant seem to get it right. I have attached an example of the production data sheet. The "tooling" sheet where they would enter the week number of service would be a separate worksheet calling to this production data sheet.

Any help would be greatly appreciated
 

Attachments

  • example.xlsx
    10.5 KB · Views: 4
One way:
Code:
=SUM(DROP(INDEX($B$2:$N$21,XMATCH($Q7,$A$2:$A$21),0),,XMATCH($R7,$B$1:$N$1)-1))
1777559790370.png
 

Attachments

  • ExcelGuru12375example.xlsx
    11.2 KB · Views: 2
Last edited:
One way:
Code:
=SUM(DROP(INDEX($B$2:$N$21,XMATCH($Q7,$A$2:$A$21),0),,XMATCH($R7,$B$1:$N$1)-1))
View attachment 12081
You sir are a gentleman and a scholar. Much appreciated, that worked a treat....

But...

I have since encountered another issue, something I should have mentioned in my first post but I didn't realise it until putting in the formula you provided. On the data sheet we are working from data from 2025 and 2026. I attempted to rename all weeks from 25 as "Week 1 25" and "Week 2 25" and so on etc, and naming the 2026 weeks as "Week 1 26" etc etc but this has stopped your formula working, meaning it will only count until the end of 25 or will miss out 25 and just count 26.

I have edited the example to show what I mean in case Im not explaining myself properly. The example shows a selection of weeks, in reality its "week 1 25" to "week 52 25" and then "week 1 26" to "week 52 26"

I think this could be to do with the match_mode of the last xmatch in the formula, but cant seem to get the wildcards to work right.

Is this easily adaptable or is it an issue with the formatting of the data?
 

Attachments

  • example.xlsx
    10.5 KB · Views: 2
Last edited:
I'm not sure what isn't working. In the attached I've added the same formula and added manually calculated totals; what should it be showing?
1777676309655.png
 

Attachments

  • ExcelGuru12375example_v2.xlsx
    11.4 KB · Views: 1
Back
Top