View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JLatham JLatham is offline
external usenet poster
 
Posts: 2,203
Default Need help with a Multiply Dependent One Cell Formula

Maybe I'm not looking at this right, but I don't think it can be done as
stated, at least not with nested IF() statements.

My first question is: What do we do if F2 is exactly zero? Condition 1 says
what to do if F2 0 while condition 4 tells what to do if F2 < 0
(conditional based yet another formula).

We may get better results if you kind of laid it out as if it were nested if
statements and see if you run into any dead ends.

An IF() statement has 3 parts: a condition to test, what to do if the test
is true, what to do if the test is false. Either of the what-to-do's can be
another IF() statement with the same constraints. Up to 7 nested IF()
statements.

Just using the first two conditions, we run into this problem:

=IF(F20, F2*D2,IF(AND((F2*D2)E2,((F1+F2)*D2)0),(D2*(F1+F2 ))+E2,E2))
IF F2 0, (true) F2 * D2,
false (F2 is either 0 or < 0) but <0 is spoken for down in condition 4 but
it would also get handled here and this second condition is a dead end for us
because it does include both a true and false result option, so there's no
where to go to nest another IF() statement it looks like this when broken out:
IF F2*D2 < E2 AND ((F1+F2)*D2)0, (true) (D2*(F1+F2))+E2, (false) E2

So there we are with no way left to get to condition 3, much less condition 4.
Basic problem seems to be that there are two things to do if F2 < 0 - those
are defined as Condition 2 and Condition 4. Physics says (or used to say)
that no two objects can occupy the same space at the same time. Computer
logic says that no single condition create two solutions - and with
conditions 2 and 4 you have 2 separate conditions to be fulfilled when F2 < 0.

But maybe a wiser head than me will come along and figure different.

Perhaps if you restructured your conditions. Try phrasing them this way:

If (condition 1) then do this, else if (condition 2), do this, else if
(condition 3), do this, else if (condition 4), do this, else if none of the 4
conditions are met, do this!

You may even have to break it down to more than just 4 conditions, or even
resequence them. We'll try to help if we can get a set of definitions that
we can work with. Although it may not be a single cell solvable thing.

"derekblain" wrote:

Hello - I'm trying to create a formula that will enable me to do the
following:

All to occur in cell G2

Condition 1.
If F2 is 0 then multiply F2 by D2.

Condition 2 in the same cell.
If the product of F2 multiplied by D2 is E2 AND the sum of F2 and F1
multiplied by D2 is 0, then add the product of D2 multiplied by the sum of
F1 and F2 to E2, otherwise input E2

Condition 3 in the same cell.
If the product of F2 multiplied D2 is < E2 BUT the sum of F2 and F1
multiplied by D2 is 0, then input the product of D2 multiplied by the sum
of F1 and F2.

Condition 4 in the same cell.
If F2 < 0, and the sum of sum of F2 and F1 multiplied by D2 is < 0, then 0.

This is the best way I could think of the write out my intention. I think if
I can get the above scenario into a one cell formula that should resolve my
pain.

Thanks in advance.

Derek