Search code examples
excelexcel-formulasumifs

SumIF three conditions meet return the forth column value


I am having two sheets Sheet1 & Sheet2, Sheet1 having four columns like EMP No, Project Number, Month & Working Days.

In the sheet2 I have same four column but some employee will be worked in two projects for that month, For example: If Emp No, project number & month matches, then 4th column value for that employee should be populated. And I am doing this by referring the cells in both the sheets.

Both sheets having the same order as mentioned in the below.

Column A = Emp No,
Column B = Project Number
Column C = Month
Column D = Working Days
=SUMIFS('Sheet2',$D$2:$D$10000,$C$2:$C$10000,"="&M2,$B$2:$B$10000,"="&C2,$A$2:$A$10000,A2)

Solution

  • I gather your aggregation happens in Sheet2 so the formula should be:

    =SUMIFS(Sheet1!D:D,Sheet1!A:A,Sheet2!A1,Sheet1!B:B,Sheet2!B1,Sheet1!C:C,Sheet2!C1)
    

    If your aggregations happens in Sheet1 just go with this one:

    =SUMIFS(Sheet2!D:D,Sheet2!A:A,Sheet1!A1,Sheet2!B:B,Sheet1!B1,Sheet2!C:C,Sheet1!C1)