Forum Discussion
Adding numerical cells based on names in another column.
Hello!! I am working on an Excel spreadsheet where people can copy and paste in their data, then there is a column that will add up time durations and display it for them. The issue is, is that there need to be multiple totals displayed since their data will have different shifts/teams. I have included a screenshot below of what the spreadsheet looks like. I added in sample data, but this would initally start out blank, then people would copy and paste their data into it.
I want that last column to add up the durations column but based on the shift/team in the Shifts/Teams column.
So basically, is there a way to make a formula that adds up the cells in one column based on the names in the cells of another?
2 Replies
- Patrick2788Silver Contributor
If you're looking to do some selective accumulation, maybe SCAN:
=SCAN( 0, duration, LAMBDA(a, v, LET(r, XMATCH(UNIQUE(shift), shift) + 1, IF(XOR(ROW(v) = r), v, a + v)) ) ) - OliverScheurichGold Contributor
=MAP(C2:C18,E2:E18,LAMBDA(dur,team,SUMIFS(C2:dur,E2:team,team)))Does this return the intended result?