# Formula to Return Blank Instead of Div Error

1. ## Formula to Return Blank Instead of Div Error

Hi,
I m having some trouble solving that DIV0 error, I checked different examples but cant find out how to solve it

= IF(E17="LONG",((I17-G17)/G17),ABS(I17-G17)/G17)

I get a DIV0 when the E17 is blank
I d like excel to return 0 if E17 is blank, if you have any idea :

Cheers

2. ## Re: Div0

Welcome to the forum.

Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

(Note: this change is not optional. As you are new, I will change it for you this time.)

3. ## Re: Formula to Return Blank Instead of Div Error

Try this:

=IFERROR(IF(E17="LONG",((I17-G17)/G17),ABS(I17-G17)/G17),0)

4. ## Re: Formula to Return Blank Instead of Div Error

The #DIV/0 ! will occur when G17 is blank - or zero, it's nothing to do with E17.

Depending on what you're trying to achieve you should either ensure G17 is never blank or wrap the formula in an =IFERROR() function.
i.e.

Formula:
`Please Login or Register  to view this content.`

5. ## Re: Formula to Return Blank Instead of Div Error

thank you for the help, I was using IFERROR withhout the second IF

6. ## Re: Formula to Return Blank Instead of Div Error

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1