Forum Discussion
Nicholas Cooke
Mar 29, 2025Copper Contributor
SUMIF. look for either of two values
I am trying to use SUMIF using to add numbers in a column if the search column finds either of two values. I though that I might be able to us the OR function as the second argument but I can't fin...
- Apr 06, 2025
Thanks. I did a work around by making an column which calculated the even numbers. Your suggestion is much more elegant.
Nick
HansVogelaar
Mar 31, 2025MVP
You mention column B twice. If you want to sum numbers in column B where column A contains 2 or 3:
=SUMIFS(B1:B100, A1, A100, 2)+SUMIFS(B1:B100, A1:A100, 3)
or shorter:
=SUM(SUMIFS(B1:B100, A1:A100, {2, 3}))
or if there are no text values in column B:
=SUM(B1:B100*((A1:A100=2)+(A1:A100=3)))
Nicholas Cooke
Apr 06, 2025Copper Contributor
Thanks. I did a work around by making an column which calculated the even numbers. Your suggestion is much more elegant.
Nick