Forum Discussion
Bradley Peters
Sep 21, 2018Copper Contributor
Using SUMIF to exclude values
Hi Guys, I would like to use SUMIF, if possible, to add up a column but to exclude values when a corresponding cell contains the text "In Flight Relief". Can anybody help?
- Sep 22, 2018can also reference a cell (Z2):
=SUMIF(Z2:Z10,"<>"&Z2,M2:M10)
where Z2 is the controlling text.
be sure that the text is consistent in all controlling cells - otherwise it won't function properly.
"In Flight Relief" is not sames as "In Flight Relief" nor "Inflightrelief"..
If Z2 is deleted then the sum will be zero.... because the controlling cell is now blank.
HTH
Lorenzo Kim
Sep 22, 2018Bronze Contributor
=SUMIF(Z2:Z10,"<>In flight Relief",M2:M10)
change the range & text to suit...
change the range & text to suit...
Lorenzo Kim
Sep 22, 2018Bronze Contributor
can also reference a cell (Z2):
=SUMIF(Z2:Z10,"<>"&Z2,M2:M10)
where Z2 is the controlling text.
be sure that the text is consistent in all controlling cells - otherwise it won't function properly.
"In Flight Relief" is not sames as "In Flight Relief" nor "Inflightrelief"..
If Z2 is deleted then the sum will be zero.... because the controlling cell is now blank.
HTH
=SUMIF(Z2:Z10,"<>"&Z2,M2:M10)
where Z2 is the controlling text.
be sure that the text is consistent in all controlling cells - otherwise it won't function properly.
"In Flight Relief" is not sames as "In Flight Relief" nor "Inflightrelief"..
If Z2 is deleted then the sum will be zero.... because the controlling cell is now blank.
HTH
- MariaF3Sep 16, 2021Copper Contributor
Lorenzo Kim thanks, thats very helpful.
How about if instead of excluding I want to only include field.
So base on the example I will be only including the "In flight Relief" in my sum calculation.
Maria
- Lorenzo KimSep 23, 2018Bronze Contributor
glad to help..
- Bradley PetersSep 23, 2018Copper Contributor
Thank you very much Lorenzo.
This formula worked for me.