Does someone know how to add a condition in SUMIFS where we check if the column contain a substring, which depends on the string of a cell. I attach a screenshot (in it, SOMME.IF.ENS is equivalent to SUMIFS, different language sorry).
Basically, in K14 I want to:
I can do 1 and 2 but for 3 I cannot find a way to make it work. Any idea? Thx
Here is what you could try using SUMIFS()
:
=K13-SUMIFS($K17:$K19,
$J17:$J19,K12,
$L17:$L19,">="&DATE($J12,1,1),
$L17:$L19,"<="&EDATE(DATE($J12,1,1)-1,12))
Or, Using SUM()
or SUMPRODUCT()
=K13-SUM((J17:J19=K12)*(YEAR(L17:L19)=J12)*K17:K19)
For Google Sheets
the second option would need a wrap up of ARRAYFORMULA()
=K13-ARRAYFORMULA(SUM((J17:J19=K12)*(YEAR(L17:L19)=J12)*K17:K19))