Using SUMIF with non-blank cells

  • Thread starter Thread starter Peter Aitken
  • Start date Start date
P

Peter Aitken

I want to use SUMIF to sum the numbers in column G only if the adjacent cell
in column H is not empty. I cannot figure out the criterion to use.

Thanks,
 
Hi Peter,

SUMIF(range,criteria,sum_range). Criteria = "<>"""

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

Regards,
Jon
 
=sumproduct(--isblank(h1:h1000),(g1:g1000))
adjust the range accordingly
 
Sorry, that doesn't work. Do a sum of the range and then deduct the blanks:

SUM(B:B)-SUMIF(A:A,"",B:B)

Cheers,
Jon
 
try this

=SUMPRODUCT(--(G1:G7),--(H1:H7<>0))

the signs are two minus signs

my data is G1 to G7 change it to suit your purposes
 
Thanks - Jason your solution is certainly nonintuitive but it works and is
the simplest one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top