I'm having issues pulling the correct data out of this Google Sheet, and could use some help.
Here is the dataset
Hours | Date | Employee
1 | 8/7/16 | Kevin
4 | 9/7/16 | John
3 | 9/3/16 | John
What I'm trying to do is match the month in a table on another sheet to the month in the date column on my example sheet
| Kevin | John |
9/1/16 | 0 | 0 |
My formula in those value fields was:
=ArrayFormula(sum((month('Sheet 1'!B2:B)=month(A2))*('Sheet 1'!C2:C="Kevin")*'Sheet 1'!A2:A))
But it's not capturing all the values and I can't really figure out why.
I'd like to write it like this:
=SUMIFS('Sheet 1'!A2:A,'Sheet 1'!C2:C,"Kevin",'Sheet 1'!B2:B, month(A2)=month('Sheet 1'!B2:B))
The problem with this one is I'm not sure how to extract just the month from the B column on Sheet 1.
Best Answer
Short answer
Try
Explanation
Include the month column inside the MONTH function, and adjust the corresponding criteria, then put the whole formula inside ARRAYFORMULA (keyboard shortcut CTRL + Shift + Enter)
Notes: The $ was added to fix the references, and "John" was replaced by the column header, so the formula could be filled right and down without making manual changes.
Alternative 1
This does exactly the same than the above.
Alternative 2
This formula will create the result matrix automatically with one formula.