ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Getting rid of error messages while using IF statements (https://www.excelbanter.com/excel-discussion-misc-queries/86663-getting-rid-error-messages-while-using-if-statements.html)

[email protected]

Getting rid of error messages while using IF statements
 
Hello,

I have a series of relatively simple formulas, set up in a complex
manner that are returning errors on me.

I have an assumptions sheet that the first formula makes reference to.
Sometimes a cell in the assumptions will be blank, and sometimes it
won't as the data changes. the first formula is:

A10
=1/Assumptions!AB18

Now if the cell in Assumptions!AB18 happens to be blank, the next
formula will return a #DIV/0 error:

C10
=$A10*C$3

Finally, if there is a 0 or #DIV/0 in C10 then the formula in E10 will
error out as well.

E10
=IF(D10="",$A10*D$3,($A10-((D10/2)*$A10))*D$3)

I realize this may be troublesome to get the mind around. But is there
any way, in the last formula (E10) to tell it to do nothing if C10 is
blank? And the same for C10, and then the same for A10?


Dave O

Getting rid of error messages while using IF statements
 
You can generally get around this type of hurdle with an IF statement:
for instance
=IF(Assumptions!AB18=0,"",1/Assumptions!AB18)
This returns a blank if AB18 equals zero, and performs the division if
AB18 is not zero.

Can you use that logic to flow through the various calculations in your
sprdsht?


Bondi

Getting rid of error messages while using IF statements
 
Hi,

You could use something like

=IF(ISERROR(C10),"",$A10*D$3,($A10-((D10/2)*$A10))*D$3)

This will give you a blank in case C10 is #DIV/0

Regards,
Bondi


[email protected]

Getting rid of error messages while using IF statements
 
**********
You can generally get around this type of hurdle with an IF statement:
for instance
=IF(Assumptions!AB18=0,"",1/Assumptions!AB18)
This returns a blank if AB18 equals zero, and performs the division if
AB18 is not zero.

Can you use that logic to flow through the various calculations in your

sprdsht?
***********

Unfortunately not. Having it display a blank is recognized by excel,
which then in turn causes the other cells to display a #VALUE error.

***********
Hi,

You could use something like


=IF(ISERROR(C10),"",$A10*D$3,($A10-((D10/2)*$A10))*D$3)


This will give you a blank in case C10 is #DIV/0

Regards,
Bondi
**********
Much appreciated but unfortunately the formula does not work - too many
arguements.


[email protected]

Getting rid of error messages while using IF statements
 
I tried mucking this around as it has promise but really cant get it to
work.

=IF(ISERROR(C10),"",$A10*D$3,($A10-((D10/2)*$A10))*D$3)

to

=IF(ISERROR(C10),"",(if(c10<"",$A10*D$3,($A10-((D10/2)*$A10))*D$3)))

Which worked :) Thanks so much for the headstart!



All times are GMT +1. The time now is 09:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com