IF #div/0! replace with 0

How do I edit this formula so it will still return a 0 if F2 = 0 as well as G2?

=IF(G2=0," ",(G2/F2))
robmarr700Asked:
Who is Participating?
 
Phillip BurtonConnect With a Mentor Director, Practice Manager and Computing ConsultantCommented:
=IF(OR(f2=0,G2=0),0,(G2/F2))
0
 
Saqib Husain, SyedEngineerCommented:
For this case

=if(f2=0,0,g2/f2)

should be sufficient
0
 
IrogSintaCommented:
Yes, if G2 was 0, then the formula G2/F2 would yield 0 because 0 divided by any number equals 0.  So as was already mentioned by ssaqibh, all you really need is:
=IF(F2=0,0,G2/F2)
0
 
Hakan YılmazTechnical Office MEP EngineerCommented:
If you just want to see zero instead #div/0!, you may use, =IFERROR(G2/F2,0)
But this will hide other errors too.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.