Excelistas Assemble
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

Excelistas Assemble

9 Posts
5 Users
0 Reactions
247 Views
 IHN
Posts: 19694
Full Member
Topic starter
 

My data looks like this, but imagine the dates cover a full year and there are many more widget codes.

image.png

I need to determine, for a given widget code and month, the maximum number of widgets produced in a single day across the two shifts, regardless of widget version.

MAXIFS using the month and widget code as criteria won't work, cos that'll just pull back the greatest single cell and I need the maximum of the sum of the multiple rows that relate to a single day.

Ideas?

 
Posted : 29/09/2025 12:10 pm
Posts: 10761
Full Member
 

I'd use Get Data to pull that table into the data model then use Power Query to wrangle it to produce an output table of month, widget, max daily sum. That's not something I can describe step by step from my phone though!

Edit - or you can probably get away with doing it via a pivot table to give the sum of each widget by day then using maxifs on that.

 
Posted : 29/09/2025 12:18 pm
 Olly
Posts: 5169
Free Member
 

Is that not a pretty simple Pivot Table?

 
Posted : 29/09/2025 12:24 pm
Posts: 12507
Free Member
 

Pivot table.

With a sum for each month and wdget.

I can't think off my head if you can combine date and widget. The usual way round the is to concatenate your two columns to create a unique singecell id =a2&b2 then set that as your pivot series.

I am post marathon today so might be talking gibberish but its something like that.

 
Posted : 29/09/2025 12:25 pm
 IHN
Posts: 19694
Full Member
Topic starter
 

It's definitely doable in a Pivot Table, but I need the value to appear in a cell in a 'monthly summary data' tab that has various totals/stats for each month and pulls data from various places. I've been asked to add 'greatest number of each widget type produced in a single day' to that tab, and that needs to auto-populate/calculate for each month from the source data (which is the table above). 

 
Posted : 29/09/2025 12:29 pm
Posts: 12507
Free Member
 

You can have more than one pivot table. Have a sheet with all the pivot tables arranged like a dashboard. Or take the answers somewhere else. If you already have a sheet in mind.

If you wantto do ot manually then something like 

=A1&A2

Then use an UNIQUE or some INDEX(thats an array formula so needs to be entered correctly ) to build a list of all the above combinations (a single row for each combo)

Then on the next columns use lookups and sums and maximums to build the table you want.

That will give you a dynamic list of date and widget values. 

 

 
Posted : 29/09/2025 1:12 pm
 IHN
Posts: 19694
Full Member
Topic starter
 

Did it - used SUMIFS as an array formula with

- the month and widget codes as criteria

- an additional criteria that used SEQUENCE to create a range of all the dates in a given month

That gave an array of total volumes per day for the given month and widget, then did a MAX of that array

{MAX(SUMIFS(WidgetCount,[WidgetCode,GivenWidgetCode],[Month,GivenMonth],[Date,(SEQUENCE(DaysInMonth,1,Month StartDate,1))]))}

Easy, eh?

 
Posted : 29/09/2025 3:00 pm
Posts: 23277
Free Member
 

I was about to suggest SUMIFS but you got there on your own. 

 
Posted : 29/09/2025 3:11 pm
 Olly
Posts: 5169
Free Member
 

tbh, stuff like this is ChatGPT's forte. throw what youve put into it and itll sort you out:

 

Exactly — you’ve spotted the limitation of MAXIFS: it works on single cells, not on grouped daily totals.

Goal restated:
For each Month and Widget Code, find the maximum total widgets produced in a single day — summing both Day + Night shifts (and ignoring Widget Version).

 


💡 Option 1: Use a Pivot Table

  1. Select your full dataset.

  2. Go to Insert → PivotTable.

  3. In the PivotTable Field List:

    • Drag Month → Rows

    • Drag Widget Code → Rows (below Month)

    • Drag Date → Rows (below Widget Code)

    • Drag Total Number of Widgets → Values → change to Sum of Total Number of Widgets

  4. Now you have total widgets per day.

  5. To get the maximum per month & widget code:

    • Right-click the Pivot → Show Values As → None (to keep raw sums)

    • Then either:

      • Add another pivot on top of this one summarizing by Month + Widget Code and using Max of Total per Day, or

      • Copy the daily totals into a new table and use =MAXIFS(...) on those summed values.

🔸 Best for: visual exploration and flexible reporting.

💡 Option 2: Use a Helper Column + MAXIFS

  1. Add a helper column:
    =SUMIFS([Total Number of Widgets],[Date],[@Date],[Widget Code],[@[Widget Code]])
    → This gives the total widgets per widget code per date.
    (If you have multiple months, include Month as a criterion.)

  2. Then use:
    =MAXIFS([HelperColumn],[Month],targetMonth,[Widget Code],targetCode)

🔸 Best for: staying purely formula-based without pivots.

 
Posted : 29/09/2025 3:27 pm

6 DAYS LEFT
We are currently at 95% of our target!