another IF query

D

Dr. Harvey Waxman

=IF(P12="yes",IF(M12<N12/1000*$N$5,N12/1000*$N$5,IF(P12="New",N12*$N$5/1000,IF(B
12="R",M12*(1+$N$4),M12*(1+$N$3)))))

There are three possibilities for P, ""yes", "New" or blank

If P is "yes" I get the correct number, otherwise I get FALSE.

Can anyone help?

Thanks

Harvey

..
 
B

Bob Greenblatt

=IF(P12="yes",IF(M12<N12/1000*$N$5,N12/1000*$N$5,IF(P12="New",N12*$N$5/1000,IF
(B
12="R",M12*(1+$N$4),M12*(1+$N$3)))))

There are three possibilities for P, ""yes", "New" or blank

If P is "yes" I get the correct number, otherwise I get FALSE.

Can anyone help?

Thanks

Harvey

.
Yes, You've got your parentheses mixed up. Try:

=IF(P12="yes",IF(M12<N12/1000*$N$5,N12/1000*$N$5),IF(P12="New",N12*$N$5/1000
,IF(B12="R",M12*(1+$N$4),M12*(1+$N$3))))


I think this is right, but it's hard to see what you really mean due to the
line wrap. So, it should look like this:

=if(p12="yes,do stuff,if(p12="new",do other stuff,do blank stuff))
 
D

Dr. Harvey Waxman

Yes, You've got your parentheses mixed up. Try:

=IF(P12="yes",IF(M12<N12/1000*$N$5,N12/1000*$N$5),IF(P12="New",N12*$N$5/1000
,IF(B12="R",M12*(1+$N$4),M12*(1+$N$3))))


I think this is right, but it's hard to see what you really mean due to the
line wrap. So, it should look like this:

=if(p12="yes,do stuff,if(p12="new",do other stuff,do blank stuff))

Undoubtedly I am mixed up. Thanks for the reply.
This also has some unintended reactions.

Here's what I am trying to do, in words.

If P12 is "new" then there is a simple calculation _ N12*N5/1000

but if it isn't "New" then I have another question.

Is P12 "yes"?. If it is then I need to know if M12 is greater than N12*N5/1000.

If it is greater, use it _ M12. Otherwise use N12*N5/1000.

But if P12 is not "yes", that is anything BUT New or yes, then ask if B12 ="R".

If so then the answer is M12*(1+N4), otherwise it's M12*(1+N3)

Hope this is not too confusing.

Harvey
 
D

Domenic

Try...

=IF(P12="New",N12*N5/1000,IF(P12="Yes",IF(M12>N12*N5/1000,M12,N12*N5/1000
),IF(B12="R",M12*(1+N4),M12*(1+N3))))

Hope this helps!
 
J

JE McGimpsey

Dr. Harvey Waxman said:
Here's what I am trying to do, in words.

If P12 is "new" then there is a simple calculation _ N12*N5/1000

but if it isn't "New" then I have another question.

Is P12 "yes"?. If it is then I need to know if M12 is greater than
N12*N5/1000.

If it is greater, use it _ M12. Otherwise use N12*N5/1000.

But if P12 is not "yes", that is anything BUT New or yes, then ask if B12
="R".

If so then the answer is M12*(1+N4), otherwise it's M12*(1+N3)

Here's how I would approach it:

First condition:

=IF(P12="new", TRUE, FALSE)

Substitute the TRUE branch

=IF(P12="new", N12*N5/1000, FALSE)

Substitute the 2nd condition for the 1st FALSE Branch

=IF(P12="new", N12*N5/1000, IF(P12="yes", TRUE, FALSE))

Continuing, substituting for each branch...

=IF(P12="new", N12*N5/1000, IF(P12="yes", IF(M12>N12*N5/1000, TRUE,
FALSE), FALSE))

=IF(P12="new", N12*N5/1000, IF(P12="yes", IF(M12>N12*N5/1000, M12,
FALSE), FALSE))

=IF(P12="new", N12*N5/1000, IF(P12="yes", IF(M12>N12*N5/1000, M12,
N12*N5/1000), FALSE))

=IF(P12="new", N12*N5/1000, IF(P12="yes", IF(M12>N12*N5/1000, M12,
N12*N5/1000), IF(B1="R", TRUE, FALSE)))

=IF(P12="new", N12*N5/1000, IF(P12="yes", IF(M12>N12*N5/1000, M12,
N12*N5/1000), IF(B1="R", M12*(1+N4), FALSE)))

=IF(P12="new", N12*N5/1000, IF(P12="yes", IF(M12>N12*N5/1000, M12,
N12*N5/1000), IF(B1="R", M12*(1+N4), M12*(1+N3))))

OTOH, you could also make it a bit simpler:

=IF(P12="new", N12*N5/1000, IF(P12="yes", MAX(M12, N12*N5/1000),
M12*(1+IF(B12="R", N4, N3))))
 
D

Dr. Harvey Waxman

Here's how I would approach it:

First condition:

=IF(P12="new", TRUE, FALSE)

Substitute the TRUE branch snip

=IF(P12="new", N12*N5/1000, IF(P12="yes", IF(M12>N12*N5/1000, M12,
N12*N5/1000), IF(B1="R", M12*(1+N4), M12*(1+N3))))
Thanks to you all, yet again. I finally got it right just before these came in
but as always you are most generous and helpful
OTOH, you could also make it a bit simpler:

=IF(P12="new", N12*N5/1000, IF(P12="yes", MAX(M12, N12*N5/1000),
M12*(1+IF(B12="R", N4, N3))))

Even neater. Lots yet to learn

Harvey
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top