Sumifs statemenet returns - , how to use in if statement?

R

Robbro

I have a sumifs statement that totals lbs by customer and lot and date.
Sometimes it will return a value of 0 for certain date ranges. Later on in
the spreadsheet I divide by lbs and I dont want 0 lbs to return an error, so
I'm trying to put an if statement in to return 0 if lbs is 0, but I cannot
find a value that will work in the following....
=if(lbs=0,0,formula), I have also tried - which is what shows up in the lbs
column instead of 0, and I have tried "", "-", and "0". What value do i put
in my IF statement to match a 0 sumifs???
 
R

Robbro

OK, nevermind, brainfart which I figured out right after hitting post. I was
ending my IF statement before dividing by pounds instead of after
=IF(lbs=0,0,sumifs(etc...))/lbs
instead of
=IF(lbs=0,0,sumifs(etc....)/lbs)

What a difference a ) makes!
 
B

Bernard Liengme

If I have a SUMIF formula in D1 and in F1 I want =45/D1 then I replace the
F1 formula by
=IF(D1=0,"X",45/D1) to avoid division by zero
The X can be replaced by anything or deleted leaving ""
best wishes
 

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