问题
The practical example is: I need to sum the total amount of time worked on a week for specific roles (engineer, etc..) within the company. What I need is to sum a column of values only if the name on the left has a specific role. I could put that role on a column next to the name, but as I would like to keep a history of employee promotion, the role is on a similar week basis table.
Following, we can see the workload tab (with the name and column to sum for example, sum column E) and the people with the name and the roles A21:AB37.
So I am trying to, for example, place the sum of hours(workload) from 'estag 1' people (name matches 'people' tab) on the 'data' tab, on C40
Following is a copy of the Sheets, feel free to update: https://docs.google.com/spreadsheets/d/1GgQGM7Pca0P3kdZurIBwQP9EMTILswc3sIWF11xXMMM/edit?usp=sharing
I've tried a sumif with filter inside, query, vlookup, but I couldn't get to a working function.
Any suggestions??
回答1:
try:
=COUNTA(IFERROR(FILTER(people!$A$24:$A, people!C$24:C=$B40)))
and drag down and to the right as needed
UPDATE
=ARRAYFORMULA(SUM(IFERROR(VLOOKUP(IFERROR(
FILTER(people!$A$24:$A, people!C$24:C=$B40), "♥"),
{people!$A$2:$A, people!C$2:C}, 2, 0))))
来源:https://stackoverflow.com/questions/59184293/is-there-a-way-to-sumifs-based-on-a-condition-for-a-output-range