How to get rid of Div/0 in my formula

baindes

Board Regular
Joined
Dec 5, 2005
Messages
183
this formula gives me a Div/0 error. How can I add to this so when I divide and the end if gives me 0 or "" nothing? Thank you.

=IF(ISERROR(VLOOKUP($C8,Queries!$E$14:$F$105,2,FALSE)),0,VLOOKUP($C8,Queries!$E$14:$F$105,2,FALSE))/AB8
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Try this
Code:
=if(ab8=0,0,IF(ISERROR(VLOOKUP($C8,Queries!$E$14:$F$105,2,FAL SE)),0,VLOOKUP($C8,Queries!$E$14:$F$105,2,FALSE))/AB8)
<!-- / message -->
 
Upvote 0
mikerickson gave me this:

Code:
Function ShowNoError(unCorrected As Variant, Optional ShowIfError As Variant) As Variant
    If IsMissing(ShowIfError) Then ShowIfError = vbNullString
    If IsError(unCorrected) Then
        ShowNoError = ShowIfError
    Else
        ShowNoError = unCorrected
    End If
End Function

It's a function, so your put the whole forumal inside =shownoerror() and you will get a zero instead of #N/A. You can even amend the function to get fish & chips instead of zero, if you want to.
 
Upvote 0
Oh wow ! Never seen that scroll bar in a post - that wasn't deliberate on my part ! Anyone know how to remove it ?
 
Upvote 0
Try

=IF(ISERROR(VLOOKUP($C8,Queries!$E$14:$F$105,2, FALSE)/AB8),0,VLOOKUP($C8,Queries!$E$14:$F$105,2,FALSE)/AB8)
 
Upvote 0

Forum statistics

Threads
1,221,607
Messages
6,160,787
Members
451,671
Latest member
kkeller10

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