Sum if not null

F

Fred Smith

I would like to sum all cells which are non-blank (same as selecting non-blank
cells in a filter). I tried

=sumif(A:A,"<>""""",B:B)

but Excel didn't think much of it.

What is the correct criteria for 'not null'?
 
M

Max

Fred,
Perhaps try something like:
=SUMPRODUCT(--(A1:A100<>""),B1:B100)
Adapt the ranges to suit. We can't use entire col refs in SP.
 
M

Max

=SUMIF(A:A,"<>",B:B)

Above doesn't seem to return correctly if col A contained null strings: "",
which was what I thought Fred was looking for. That's why I suggested the
good, old Sumproduct way <g>.
 
J

JMB

I see what you mean. Good call. I'll have to try to remember that
particular "feature". <g>
 
Top