![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: Canada
Posts: 50
|
Can anyone tell me why this insists on bringing up the #DIV/0! Error
=IF((E6-F6)/E6="0","",(E6-F6)/E6) |
|
|
|
|
|
#2 |
|
New Member
Join Date: Apr 2002
Posts: 4
|
"IF((E6-F6)/E6="0","",(E6-F6)/E6)"
most probably E6 has 0 or no value. Try checking the value of E6 instead of checking the whole formula in the if condition. |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
In addition to what Shalini noted:
Any number including 0 divided by 0 is undefined and Excel renders this as #DIV/0! An empty cell in math expressions interpreted by Excel as 0. Rewrite your formula as: =IF(E6,(E6-F6)/E6,"") |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
|
your first arguement that says if it's equal to "0" is telling it to recognise a textual value of "0"
even if your (E6-f6/e6) is zero, it's not recognising it as text, and thusly defaulting to your 2nd arguement, which results in a division by zero.... drop the "quotes" or go with Aladin's more compact solution
__________________
:: Pharma Z - Family drugstore :: |
|
|
|
|
|
#5 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
|
|
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
|
Guess what : I posted without testing it first.
Naughty Chris |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|