Solved via an intermediate table:
- using unique() on both the Group and Item columns
- using sumifs() with a criteria on each Group and Item
- adding an extra column for subtracting the threshold
And using a pivot table on that intermediate table as a quick way to preserve the original appearance.