![]() |
![]() |
|
|||||||
| 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 |
|
New Member
Join Date: May 2002
Posts: 3
|
I have a reasonably complicated spreadsheet which includes whatif functions in certain areas. In one particular "if" function, the formula includes a divisible calculation that may under certain circumstances become "0" but in other circumstances become a number greater than "0". In other words the "if" function needs this formula. How do I have excel ignore the "div/0" error when this condition exists. Here is the formula:
=IF(DL23*(AJ23+AK23)/SUM(AJ23:BI23) DL23 will always have a number great than "0" AJ23 & AK23 may not have a number great than "0" SUM(AJ23:BI23) may not have a number great than "0" DB23 may not have a number great than "0" Your help would be greatly appreciated Garry [ This Message was edited by: pilot48 on 2002-05-11 14:42 ] |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
=if(my [FORMULA] DIVISOR = 0, then Show 0 or "",Otherwise show my [FORMULA]) |
|
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
could be what you are looking for? |
|
|
|
|
|
|
#4 |
|
New Member
Join Date: May 2002
Posts: 3
|
Hi Ivan
I'm sorry but I dids not post my entire formula...could you suggest the amendment =IF(DL23*(AJ23+AK23)/SUM(AJ23:BI23) Thanks Garry [ This Message was edited by: pilot48 on 2002-05-11 14:41 ] |
|
|
|
|
|
#5 | ||
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Thats strange ?? I answered your post
Assuming what was posted as; Quote:
And Alladins shows: Quote:
Go with what Alladin has given... |
||
|
|
|
|
|
#6 |
|
New Member
Join Date: May 2002
Posts: 3
|
Hi
Aladin's suggestion worked in terms of removing the div/o error, but it does not default to DB23 in the event that there is a numerical value in that cell after the formula tests to the calculation DL23*(AJ23+AK23)/SUM(AJ23:BI23) Garry |
|
|
|
|
|
#7 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
You lost me: The formula I suggested doesn't have the test: DL23*(AJ23+AK23)/SUM(AJ23:BI23) It's rather meant to replace your original formula as a whole. The formula =MAX(IF(SUM(AJ23:BI23),(DL23*(AJ23+AK23))/SUM(AJ23:BI23),0),DB23) compares the result of (DL23*(AJ23+AK23))/SUM(AJ23:BI23) with the value in DB23, picks out whichever is bigger. Now it is up to you to say what must be the case, so we can adjust the formula. Aladin [ This Message was edited by: Aladin Akyurek on 2002-05-11 15:34 ] |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|