Nested IF & Nested AND


D

diablo

I'm trying to compare two cells to create two different outcomes. The
formula I'm using is as follows;

=IF((AND(H15="Capitol",I15="both")),F15/2,),IF((AND(H15="Capitol",I15="MPL41")),F15,)

Cell H15 does equal Capitol, Cell I15 does equal both, Cell F15 does
equal $3,094.36. When I use this formula I get the correct answer of
$1,547.18
=IF((AND(H15="Capitol",I15="both")),F15/2,)

When I try to nest another IF as shown above I get the error #value!.

By adding the IF((AND(H15="Capitol",I15="MPL41")),F15,) I want to
create a second condition for when I15 changes it's value to "MPL41".

What am I doing wrong?

Thanks,
Brian
 
Ad

Advertisements

D

Don Guillett

Not sure I understand but try something like
if(h15="capitol"),f15/if(i15="both",2,1),"")
 
Ad

Advertisements

J

joeu2004

I'm trying to compare two cells to create two different outcomes.
The formula I'm using is as follows;

=IF((AND(H15="Capitol",I15="both")),F15/2,),
IF((AND(H15="Capitol",I15="MPL4-1")),F15,)
[....]
What am I doing wrong?
Your error is the extraneous ",)" after f15/2. One way to write that
is:

=if(and(H15="Capitol",I15="both"), F15/2,
if(and(H15,"Capitol",I15="MPL41"), F15, "")

Note: It is unwise to have an empty value-if-false part. If neither
condition is met, the result is FALSE instead of a numeric value.
However, you might want to replace "" with something else, perhaps 0.
 

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

Similar Threads

Nesting 2
Nested IF Conditions 6
Nested IF Statements 1
A nasty nested if 4
Nested Formulas 2
If statements nested 2
Nest IF alternative? 5
If formula nesting 3

Top