sumif function leaving a blank cell when criteria not met

A

Andy H

I'm having some difficulty trying to clean up a spreadsheet and need some help.

I'm using SUMIF to fill a section on my worksheet where i can check for
totals by value (example: A1:A30 is data and B1:B30 is a number 1-5, i then
am tracking the SUM of each number from B1:B30) which is working ok, except
that i occasionally have unused numbers that leave a "0" for a result in my
SUMIF function. IF for example in B1:B30 i have no "2" my formula still
leaves a "0" and that can be very harmful to my book keeping.

Example of Forumla:

{=SUMIF(B1:B30,2,A1:A30)}
Is there then a way to show "N/A" for unused values?
TIA
 
R

Rick Rothstein

This formula seems to work...

=IF(COUNTIF(B1:B30,2),SUMPRODUCT((B1:B30=2)*A1:A30),NA())
 
A

Andy H

Thank you both, i'll try both today and see which one is easier for a rookie
like myself to understand :)
 

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

Top