ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Overlaping conditions....may be (https://www.excelbanter.com/excel-worksheet-functions/167420-overlaping-conditions-may.html)

Gaurav[_2_]

Overlaping conditions....may be
 
=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE"),"INVALID ENTRY",IF(AND(OR(I28="NOT
APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0)),(I12/(1-I11)),IF(I27=1,(I12/(1-I11))-0.5,IF(I271,0,IF(I28=1,(I12/(1-I11))-0.25,IF(I28=2,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),IF(AND(I27=1,I280),(I12/(1-I11))-(0.5)-((COUNTIF(I75:I85,"N"))*0.03),"")))))))

This formuila was working fine before today when the figure in I12 went
below 50%. The result was in minus instead of 0.

any ideas?

Thanks in advance.



Don Guillett

Overlaping conditions....may be
 

Hard to tell without getting into your mind and the program. Best to break
out the part that controls that and work with it in chunks. One suggestion:

if(countif(i23:k25,"NOT APPLICABLE")<3, "Invalid Entry",etc....
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Gaurav" wrote in message
...
=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE"),"INVALID ENTRY",IF(AND(OR(I28="NOT
APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0)),(I12/(1-I11)),IF(I27=1,(I12/(1-I11))-0.5,IF(I271,0,IF(I28=1,(I12/(1-I11))-0.25,IF(I28=2,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),IF(AND(I27=1,I280),(I12/(1-I11))-(0.5)-((COUNTIF(I75:I85,"N"))*0.03),"")))))))

This formuila was working fine before today when the figure in I12 went
below 50%. The result was in minus instead of 0.

any ideas?

Thanks in advance.



Sandy Mann

Overlaping conditions....may be
 
If you don't want a negative return the would wrapping every calculation
involving I12 with a number subtracted in a MAX() function do what you want?

Like:

,MAX(,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),0),

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE"),"INVALID ENTRY",IF(AND(OR(I28="NOT
APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0)),(I12/(1-I11)),IF(I27=1,(I12/(1-I11))-0.5,IF(I271,0,IF(I28=1,(I12/(1-I11))-0.25,IF(I28=2,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),IF(AND(I27=1,I280),(I12/(1-I11))-(0.5)-((COUNTIF(I75:I85,"N"))*0.03),"")))))))

This formuila was working fine before today when the figure in I12 went
below 50%. The result was in minus instead of 0.

any ideas?

Thanks in advance.





Gaurav[_2_]

Overlaping conditions....may be
 
That looks like the solution but not sure how to use it. Never used MAX in
such a scenario.

"Sandy Mann" wrote in message
...
If you don't want a negative return the would wrapping every calculation
involving I12 with a number subtracted in a MAX() function do what you
want?

Like:

,MAX(,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),0),

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE"),"INVALID ENTRY",IF(AND(OR(I28="NOT
APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0)),(I12/(1-I11)),IF(I27=1,(I12/(1-I11))-0.5,IF(I271,0,IF(I28=1,(I12/(1-I11))-0.25,IF(I28=2,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),IF(AND(I27=1,I280),(I12/(1-I11))-(0.5)-((COUNTIF(I75:I85,"N"))*0.03),"")))))))

This formuila was working fine before today when the figure in I12 went
below 50%. The result was in minus instead of 0.

any ideas?

Thanks in advance.







Sandy Mann

Overlaping conditions....may be
 
mmmmm......

As written, you run in to the 7 nested function problem if you just add the
MAX() functions.

However, you have an IF() statement:

IF(I27=1,(I12/(1-I11))-0.5

before another IF() statement:

IF(AND(I27=1,I280),(I12/(1-I11))-(0.5)-((COUNTIF(I75:I85,"N"))*0.03)

If I27 is 1, then the formula can never get to the 2nd IF() so it would be
better to reverse them. That then allows you to add the MAX() functions
without hitting the 7 nested functions limit:

=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE"),"INVALID ENTRY",IF(AND(OR(I28="NOT
APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0)),I12/(1-I11),IF(AND(I27=1,I280),MAX(I12/(1-I11)-0.5-COUNTIF(I75:I85,"N")*0.03,0),IF(I271,0,IF(I28=1,M AX(I12/(1-I11)-0.25,0),IF(I28=2,MAX(I12/(1-I11)-0.25-(COUNTIF(I75:I85,"N")-1)*0.03,0),IF(I27=1,MAX(I12/(1-I11)-0.5,0),"")))))))

I have also removed several brackets, (there is no need to enclose 0.25 in
brackets and Excel will perform multiplication and division before addition
and subtraction without the need of brackets).

Check that I have not altered the logic of your formula.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
That looks like the solution but not sure how to use it. Never used MAX in
such a scenario.

"Sandy Mann" wrote in message
...
If you don't want a negative return the would wrapping every calculation
involving I12 with a number subtracted in a MAX() function do what you
want?

Like:

,MAX(,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),0),

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE"),"INVALID ENTRY",IF(AND(OR(I28="NOT
APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0)),(I12/(1-I11)),IF(I27=1,(I12/(1-I11))-0.5,IF(I271,0,IF(I28=1,(I12/(1-I11))-0.25,IF(I28=2,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),IF(AND(I27=1,I280),(I12/(1-I11))-(0.5)-((COUNTIF(I75:I85,"N"))*0.03),"")))))))

This formuila was working fine before today when the figure in I12 went
below 50%. The result was in minus instead of 0.

any ideas?

Thanks in advance.










Gaurav[_2_]

Overlaping conditions....may be
 
Hey..so far so good. It seems to be working fine. Thanks a ton.

2 more questions for you.

1. what does MAX function do here?

2. Can we add one more condition? i.e.IF(I300,"").


"Sandy Mann" wrote in message
...
mmmmm......

As written, you run in to the 7 nested function problem if you just add
the MAX() functions.

However, you have an IF() statement:

IF(I27=1,(I12/(1-I11))-0.5

before another IF() statement:

IF(AND(I27=1,I280),(I12/(1-I11))-(0.5)-((COUNTIF(I75:I85,"N"))*0.03)

If I27 is 1, then the formula can never get to the 2nd IF() so it would be
better to reverse them. That then allows you to add the MAX() functions
without hitting the 7 nested functions limit:

=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE"),"INVALID ENTRY",IF(AND(OR(I28="NOT
APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0)),I12/(1-I11),IF(AND(I27=1,I280),MAX(I12/(1-I11)-0.5-COUNTIF(I75:I85,"N")*0.03,0),IF(I271,0,IF(I28=1,M AX(I12/(1-I11)-0.25,0),IF(I28=2,MAX(I12/(1-I11)-0.25-(COUNTIF(I75:I85,"N")-1)*0.03,0),IF(I27=1,MAX(I12/(1-I11)-0.5,0),"")))))))

I have also removed several brackets, (there is no need to enclose 0.25 in
brackets and Excel will perform multiplication and division before
addition and subtraction without the need of brackets).

Check that I have not altered the logic of your formula.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
That looks like the solution but not sure how to use it. Never used MAX
in such a scenario.

"Sandy Mann" wrote in message
...
If you don't want a negative return the would wrapping every calculation
involving I12 with a number subtracted in a MAX() function do what you
want?

Like:

,MAX(,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),0),

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE"),"INVALID ENTRY",IF(AND(OR(I28="NOT
APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0)),(I12/(1-I11)),IF(I27=1,(I12/(1-I11))-0.5,IF(I271,0,IF(I28=1,(I12/(1-I11))-0.25,IF(I28=2,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),IF(AND(I27=1,I280),(I12/(1-I11))-(0.5)-((COUNTIF(I75:I85,"N"))*0.03),"")))))))

This formuila was working fine before today when the figure in I12 went
below 50%. The result was in minus instead of 0.

any ideas?

Thanks in advance.












Sandy Mann

Overlaping conditions....may be
 
1. what does MAX function do here?

It returns the higher value of your calculation and zero so that if the
calculation was going to be a minus it would return the higher value which
is zero.

2. Can we add one more condition? i.e.IF(I300,"").


No, not if you want that test to override the other tests, (ie if I300 then
return "" no matter what else), unless you have XL2007 because you run into
the 7 nested function rule again.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
Hey..so far so good. It seems to be working fine. Thanks a ton.

2 more questions for you.

1. what does MAX function do here?

2. Can we add one more condition? i.e.IF(I300,"").


"Sandy Mann" wrote in message
...
mmmmm......

As written, you run in to the 7 nested function problem if you just add
the MAX() functions.

However, you have an IF() statement:

IF(I27=1,(I12/(1-I11))-0.5

before another IF() statement:

IF(AND(I27=1,I280),(I12/(1-I11))-(0.5)-((COUNTIF(I75:I85,"N"))*0.03)

If I27 is 1, then the formula can never get to the 2nd IF() so it would
be better to reverse them. That then allows you to add the MAX()
functions without hitting the 7 nested functions limit:

=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE"),"INVALID ENTRY",IF(AND(OR(I28="NOT
APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0)),I12/(1-I11),IF(AND(I27=1,I280),MAX(I12/(1-I11)-0.5-COUNTIF(I75:I85,"N")*0.03,0),IF(I271,0,IF(I28=1,M AX(I12/(1-I11)-0.25,0),IF(I28=2,MAX(I12/(1-I11)-0.25-(COUNTIF(I75:I85,"N")-1)*0.03,0),IF(I27=1,MAX(I12/(1-I11)-0.5,0),"")))))))

I have also removed several brackets, (there is no need to enclose 0.25
in brackets and Excel will perform multiplication and division before
addition and subtraction without the need of brackets).

Check that I have not altered the logic of your formula.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
That looks like the solution but not sure how to use it. Never used MAX
in such a scenario.

"Sandy Mann" wrote in message
...
If you don't want a negative return the would wrapping every
calculation involving I12 with a number subtracted in a MAX() function
do what you want?

Like:

,MAX(,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),0),

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE"),"INVALID ENTRY",IF(AND(OR(I28="NOT
APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0)),(I12/(1-I11)),IF(I27=1,(I12/(1-I11))-0.5,IF(I271,0,IF(I28=1,(I12/(1-I11))-0.25,IF(I28=2,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),IF(AND(I27=1,I280),(I12/(1-I11))-(0.5)-((COUNTIF(I75:I85,"N"))*0.03),"")))))))

This formuila was working fine before today when the figure in I12
went below 50%. The result was in minus instead of 0.

any ideas?

Thanks in advance.















Gaurav[_2_]

Overlaping conditions....may be
 
Thanks Sandy.

if I300 then return "" no matter what else....this is what i want. when I30
goes 0, that is actually when i want other calculations to be done.


"Sandy Mann" wrote in message
...
1. what does MAX function do here?


It returns the higher value of your calculation and zero so that if the
calculation was going to be a minus it would return the higher value which
is zero.

2. Can we add one more condition? i.e.IF(I300,"").


No, not if you want that test to override the other tests, (ie if I300
then return "" no matter what else), unless you have XL2007 because you
run into the 7 nested function rule again.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
Hey..so far so good. It seems to be working fine. Thanks a ton.

2 more questions for you.

1. what does MAX function do here?

2. Can we add one more condition? i.e.IF(I300,"").


"Sandy Mann" wrote in message
...
mmmmm......

As written, you run in to the 7 nested function problem if you just add
the MAX() functions.

However, you have an IF() statement:

IF(I27=1,(I12/(1-I11))-0.5

before another IF() statement:

IF(AND(I27=1,I280),(I12/(1-I11))-(0.5)-((COUNTIF(I75:I85,"N"))*0.03)

If I27 is 1, then the formula can never get to the 2nd IF() so it would
be better to reverse them. That then allows you to add the MAX()
functions without hitting the 7 nested functions limit:

=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE"),"INVALID ENTRY",IF(AND(OR(I28="NOT
APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0)),I12/(1-I11),IF(AND(I27=1,I280),MAX(I12/(1-I11)-0.5-COUNTIF(I75:I85,"N")*0.03,0),IF(I271,0,IF(I28=1,M AX(I12/(1-I11)-0.25,0),IF(I28=2,MAX(I12/(1-I11)-0.25-(COUNTIF(I75:I85,"N")-1)*0.03,0),IF(I27=1,MAX(I12/(1-I11)-0.5,0),"")))))))

I have also removed several brackets, (there is no need to enclose 0.25
in brackets and Excel will perform multiplication and division before
addition and subtraction without the need of brackets).

Check that I have not altered the logic of your formula.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
That looks like the solution but not sure how to use it. Never used MAX
in such a scenario.

"Sandy Mann" wrote in message
...
If you don't want a negative return the would wrapping every
calculation involving I12 with a number subtracted in a MAX() function
do what you want?

Like:

,MAX(,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),0),

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE"),"INVALID ENTRY",IF(AND(OR(I28="NOT
APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0)),(I12/(1-I11)),IF(I27=1,(I12/(1-I11))-0.5,IF(I271,0,IF(I28=1,(I12/(1-I11))-0.25,IF(I28=2,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),IF(AND(I27=1,I280),(I12/(1-I11))-(0.5)-((COUNTIF(I75:I85,"N"))*0.03),"")))))))

This formuila was working fine before today when the figure in I12
went below 50%. The result was in minus instead of 0.

any ideas?

Thanks in advance.

















Sandy Mann

Overlaping conditions....may be
 
Try adding that test in an AND() with the other tests and use the final ""
in the formula:

=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE",I30=0),"INVALID ENTRY",IF(AND(OR(I28="NOT
APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0),I30=0),I12/(1-I11),IF(AND(I27=1,I280,I30=0),MAX(I12/(1-I11)-0.5-COUNTIF(I75:I85,"N")*0.03,0),IF(AND(I271,I30=0),0 ,IF(AND(I28=1,I30=0),MAX(I12/(1-I11)-0.25,0),IF(AND(I28=2,I30=0),MAX(I12/(1-I11)-0.25-(COUNTIF(I75:I85,"N")-1)*0.03,0),IF(AND(I27=1,I30=0),MAX(I12/(1-I11)-0.5,0),"")))))))

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
Thanks Sandy.

if I300 then return "" no matter what else....this is what i want. when
I30 goes 0, that is actually when i want other calculations to be done.


"Sandy Mann" wrote in message
...
1. what does MAX function do here?


It returns the higher value of your calculation and zero so that if the
calculation was going to be a minus it would return the higher value
which is zero.

2. Can we add one more condition? i.e.IF(I300,"").


No, not if you want that test to override the other tests, (ie if I300
then return "" no matter what else), unless you have XL2007 because you
run into the 7 nested function rule again.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
Hey..so far so good. It seems to be working fine. Thanks a ton.

2 more questions for you.

1. what does MAX function do here?

2. Can we add one more condition? i.e.IF(I300,"").


"Sandy Mann" wrote in message
...
mmmmm......

As written, you run in to the 7 nested function problem if you just add
the MAX() functions.

However, you have an IF() statement:

IF(I27=1,(I12/(1-I11))-0.5

before another IF() statement:

IF(AND(I27=1,I280),(I12/(1-I11))-(0.5)-((COUNTIF(I75:I85,"N"))*0.03)

If I27 is 1, then the formula can never get to the 2nd IF() so it would
be better to reverse them. That then allows you to add the MAX()
functions without hitting the 7 nested functions limit:

=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE"),"INVALID ENTRY",IF(AND(OR(I28="NOT
APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0)),I12/(1-I11),IF(AND(I27=1,I280),MAX(I12/(1-I11)-0.5-COUNTIF(I75:I85,"N")*0.03,0),IF(I271,0,IF(I28=1,M AX(I12/(1-I11)-0.25,0),IF(I28=2,MAX(I12/(1-I11)-0.25-(COUNTIF(I75:I85,"N")-1)*0.03,0),IF(I27=1,MAX(I12/(1-I11)-0.5,0),"")))))))

I have also removed several brackets, (there is no need to enclose 0.25
in brackets and Excel will perform multiplication and division before
addition and subtraction without the need of brackets).

Check that I have not altered the logic of your formula.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
That looks like the solution but not sure how to use it. Never used
MAX in such a scenario.

"Sandy Mann" wrote in message
...
If you don't want a negative return the would wrapping every
calculation involving I12 with a number subtracted in a MAX()
function do what you want?

Like:

,MAX(,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),0),

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE"),"INVALID ENTRY",IF(AND(OR(I28="NOT
APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0)),(I12/(1-I11)),IF(I27=1,(I12/(1-I11))-0.5,IF(I271,0,IF(I28=1,(I12/(1-I11))-0.25,IF(I28=2,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),IF(AND(I27=1,I280),(I12/(1-I11))-(0.5)-((COUNTIF(I75:I85,"N"))*0.03),"")))))))

This formuila was working fine before today when the figure in I12
went below 50%. The result was in minus instead of 0.

any ideas?

Thanks in advance.




















Gaurav[_2_]

Overlaping conditions....may be
 
You know what Sandy? YOU ROCK!!!!

Why couldnt I think of it? I should kill myself.

Thanks a ton bud.

"Sandy Mann" wrote in message
...
Try adding that test in an AND() with the other tests and use the final ""
in the formula:

=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE",I30=0),"INVALID ENTRY",IF(AND(OR(I28="NOT
APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0),I30=0),I12/(1-I11),IF(AND(I27=1,I280,I30=0),MAX(I12/(1-I11)-0.5-COUNTIF(I75:I85,"N")*0.03,0),IF(AND(I271,I30=0),0 ,IF(AND(I28=1,I30=0),MAX(I12/(1-I11)-0.25,0),IF(AND(I28=2,I30=0),MAX(I12/(1-I11)-0.25-(COUNTIF(I75:I85,"N")-1)*0.03,0),IF(AND(I27=1,I30=0),MAX(I12/(1-I11)-0.5,0),"")))))))

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
Thanks Sandy.

if I300 then return "" no matter what else....this is what i want. when
I30 goes 0, that is actually when i want other calculations to be done.


"Sandy Mann" wrote in message
...
1. what does MAX function do here?

It returns the higher value of your calculation and zero so that if the
calculation was going to be a minus it would return the higher value
which is zero.

2. Can we add one more condition? i.e.IF(I300,"").

No, not if you want that test to override the other tests, (ie if I300
then return "" no matter what else), unless you have XL2007 because you
run into the 7 nested function rule again.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
Hey..so far so good. It seems to be working fine. Thanks a ton.

2 more questions for you.

1. what does MAX function do here?

2. Can we add one more condition? i.e.IF(I300,"").


"Sandy Mann" wrote in message
...
mmmmm......

As written, you run in to the 7 nested function problem if you just
add the MAX() functions.

However, you have an IF() statement:

IF(I27=1,(I12/(1-I11))-0.5

before another IF() statement:

IF(AND(I27=1,I280),(I12/(1-I11))-(0.5)-((COUNTIF(I75:I85,"N"))*0.03)

If I27 is 1, then the formula can never get to the 2nd IF() so it
would be better to reverse them. That then allows you to add the
MAX() functions without hitting the 7 nested functions limit:

=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE"),"INVALID ENTRY",IF(AND(OR(I28="NOT
APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0)),I12/(1-I11),IF(AND(I27=1,I280),MAX(I12/(1-I11)-0.5-COUNTIF(I75:I85,"N")*0.03,0),IF(I271,0,IF(I28=1,M AX(I12/(1-I11)-0.25,0),IF(I28=2,MAX(I12/(1-I11)-0.25-(COUNTIF(I75:I85,"N")-1)*0.03,0),IF(I27=1,MAX(I12/(1-I11)-0.5,0),"")))))))

I have also removed several brackets, (there is no need to enclose
0.25 in brackets and Excel will perform multiplication and division
before addition and subtraction without the need of brackets).

Check that I have not altered the logic of your formula.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
That looks like the solution but not sure how to use it. Never used
MAX in such a scenario.

"Sandy Mann" wrote in message
...
If you don't want a negative return the would wrapping every
calculation involving I12 with a number subtracted in a MAX()
function do what you want?

Like:

,MAX(,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),0),

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gaurav" wrote in message
...
=IF(AND(I22="NOT APPLICABLE",I23="NOT APPLICABLE",I24="NOT
APPLICABLE",I25="NOT APPLICABLE"),"INVALID
ENTRY",IF(AND(OR(I28="NOT APPLICABLE",I28=0),OR(I27="NOT
APPLICABLE",I27=0)),(I12/(1-I11)),IF(I27=1,(I12/(1-I11))-0.5,IF(I271,0,IF(I28=1,(I12/(1-I11))-0.25,IF(I28=2,((I12/(1-I11))-(0.25)-((COUNTIF(I75:I85,"N")-1)*0.03)),IF(AND(I27=1,I280),(I12/(1-I11))-(0.5)-((COUNTIF(I75:I85,"N"))*0.03),"")))))))

This formuila was working fine before today when the figure in I12
went below 50%. The result was in minus instead of 0.

any ideas?

Thanks in advance.























All times are GMT +1. The time now is 01:19 PM.

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