Help with #div/0! error in IF formula

Eastbay2

New Member
Joined
Jan 31, 2013
Messages
5
Here is my current formula :

=SUM(IF($C232=data!$D:$D,IF('Combined Stores'!E$6=data!$H:$H,data!$F:$F,0),0))/SUM(IF($C232=data!$D:$D,IF('Combined Stores'!E$6=data!$H:$H,data!$E:$E,0),0))*100

The issue is that when referencing "data!$D:$D" & "data!$H:$H" sometime there is no data, resulting in the zero. The formula then divided by zero causing a #div/0! result. I want it to leave the value as zero if there is no refernce data.

Thanks for your help.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi.

Try:
=if(SUM(IF($C232=data!$D:$D,IF('CombinedStores'!E$6=data!$H:$H,data!$F:$F,0),0))=0,"",SUM(IF($C232=data!$D:$D,IF('Combi...etc your formula ...
 
Upvote 0
Here is my current formula :

=SUM(IF($C232=data!$D:$D,IF('Combined Stores'!E$6=data!$H:$H,data!$F:$F,0),0))/SUM(IF($C232=data!$D:$D,IF('Combined Stores'!E$6=data!$H:$H,data!$E:$E,0),0))*100

The issue is that when referencing "data!$D:$D" & "data!$H:$H" sometime there is no data, resulting in the zero. The formula then divided by zero causing a #div/0! result. I want it to leave the value as zero if there is no refernce data.

Thanks for your help.

Why not wrap the formula with an IFERROR call...

=IFERROR(SUM(IF($C232=data!$D:$D,IF('Combined Stores'!E$6=data!$H:$H,data!$F:$F,0),0))/SUM(IF($C232=data!$D:$D,IF('Combined Stores'!E$6=data!$H:$H,data!$E:$E,0),0))*100,0)
 
Upvote 0
Thank you Aladin!!

That worked. I was trying to use the "Iferror" before i posted for help but i couldnt figure it out. I was forgetting the ",0" after the 100, duhhh!!. Thanks again.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top