Thread: "IF" Function
View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Lars-Åke Aspelin[_2_] Lars-Åke Aspelin[_2_] is offline
external usenet poster
 
Posts: 913
Default =IF(B390,IF(B13-B440,B13-B44,0),0)

On Sat, 17 May 2008 09:41:00 -0700, Boblink
wrote:

Thank you for your help Lars, I appreciate you trying to straighten me out
since it appears that I need a LOT of help! Your advised me to "specify what
result you want if the value in B39 isn't positive" and I (slightly) modified
the formula as follows:

=IF(B390,IF(B13-B440,B13-B44,0),0)

but the results now show a POSITIVE value in cell B40 (i.e. the cell with
the formula) although cell B39 has a positive value.

I might have not stated "the problem" incorrectly so let me try rephrasing
it, what I am trying to do in cell B40 is calculate a "zero" when the value
in cell B39 is positive, calculate B13-B44 when the value in cell B39 is
"zero" and calculate a "zero" in cell B40 when the value of B13-B44 is
negative.

Thank you again for your help Lars,
Bob



This time you have not specified what you want when B39 is negative.
Maybe that will never happen.

In that case, try the following:

=IF(B390,0,IF(B13-B440,B13-B44,0))

This table shows what happens in the 9 different cases:

B390 and B13<B44 gives 0
B390 and B13=B44 gives 0
B390 and B12B44 gives 0
B39=0 and B13<B44 gives 0
B39=0 and B13=B44 gives 0
B39=0 and B13B44 gives B13-B44
B39<0 and B13<B44 gives 0
B39<0 and B13=B44 gives 0
B39<0 and B13B44 gives B13-B44

Is this what you want?
If not, provide a similar table covering ALL possible combinations
that should influence the result.

Lars-Åke