2017-06-05 196 views
0

我需要有一個函數,如果函數將返回所有值,其中約翰在列B,而不是在列A.所以它應該只返回50以下。excel sum列如果值x在列A或B和A不等於B

Column A  Column B   Column C 
John   John, Steve, Fred 100 
Steve  John    50 
Fred   Fred, Steve  150 
+0

你嘗試過這麼遠嗎? –

+0

帶有通配符的SUMIFS將幫助您 –

回答

1

您可以使用此SUMIFS:

=SUMIFS(C:C,A:A,"<>*" & "John" & "*",B:B,"=*" & "John" & "*") 

enter image description here

但可能會導致假陽性像Ann還將看到Anne

要解決這個問題,你需要改變SUMPRODUCT:

=SUMPRODUCT($C$1:$C$3,(ISERROR(SEARCH("," & "John" & ",","," & $A$1:$A$3 & ",")))*(ISNUMBER(SEARCH("," & "John" & ",","," & $B$1:$B$3 & ",")))) 

enter image description here

相關問題