Feb 19 2023 11:18 AM
Hey all, I am trying to total the number in two columns only when there are numbers in both columns. I've tried messing around with the SUMIFS function but not getting far.
Here's an example
Column 1 Column 2
4 9
8
1 2
7
If I add the numbers when only both columns have data I get 4+9+1+2=16
And it ignores the 8 and 7 since they don't have values in the adjacent column.
Is there a way to do this?
Thanks
Feb 19 2023 11:57 AM - edited Feb 19 2023 11:58 AM
@jacobg98 'Let's say your data are in A2:B5.
=SUMPRODUCT(A2:B5*(A2:A5<>"")*(B2:B5<>""))
or
=SUM(FILTER(A2:B5,(A2:A5<>"")*(B2:B5<>"")))