标签: excel sum
我需要一个总和if函数,它将返回John在B列而不是A列中的所有值。所以它应该只返回50以下。
Column A Column B Column C John John, Steve, Fred 100 Steve John 50 Fred Fred, Steve 150
答案 0 :(得分:1)
您可以使用此SUMIFS:
=SUMIFS(C:C,A:A,"<>*" & "John" & "*",B:B,"=*" & "John" & "*")
但这可能会导致误报,例如Ann也会看到Anne。
Ann
Anne
要解决这个问题,您需要更改为SUMPRODUCT:
=SUMPRODUCT($C$1:$C$3,(ISERROR(SEARCH("," & "John" & ",","," & $A$1:$A$3 & ",")))*(ISNUMBER(SEARCH("," & "John" & ",","," & $B$1:$B$3 & ","))))