ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Logical functions (https://www.excelbanter.com/excel-programming/410779-logical-functions.html)

Anil_Indian

Logical functions
 
Dear
i m using excel logical functions for some calculation,
eg
=IF(AND(C2="EBRK",K2=1),0.0001,IF(AND(C2="EBRK",K2 1),J2/K2,IF(AND(F21,E21),0.0001,IF(AND(J2<-2000),0.0001,IF(AND(E2100000),1,IF(AND(K2=10000), 3,IF(AND(F21),2,(J2/K2)*4)))))))
but now i want to add some more logic but excel not allowes me.

plz tell me how i can add or simplyfy my formula

Heera

Logical functions
 
you cannot use more then 8 if conditions in excel.

Sandy Mann

Logical functions
 
Hiw many more conditions do you want to add? If just one more condition you
can combine two of your consecutive conditions that return the same value
Vis:

IF(AND(F21,E21),0.0001,IF(AND(J2<-2000),0.0001

into:

OR(AND(F21,E21),J2<-2000),0.0001

to give:

=IF(AND(C2="EBRK",K2=1),0.0001,IF(AND(C2="EBRK",K2 1),J2/K2,IF(OR(AND(F21,E21),J2<-2000),0.0001,IF(E2100000,1,IF(K2=10000,3,IF(F21, 2,IF(A1=100,100,J2/K2*4)))))))

which allows you to add another condition at the end, [ie the IF(A1=100]
Note that you don't need all the AND() that you were using.

If the order is not critical then you can add both the conditions in the
OR() to the first condition to give:

=IF(OR(AND(C2="EBRK",K2=1),AND(F21,E21),J2<-2000),0.0001,IF(AND(C2="EBRK",K21),J2/K2,IF(E2100000,1,IF(K2=10000,3,IF(F21,2,IF(A1=10 0,100,IF(A1=200,200,J2/K2*4)))))))

Which allows you to add yet another condition, the IF(A1=200

Failing that you may be able to use a combination of MAX() or MIN() with
CHOOSE().

From the variety of conditions it looks to me as if it would be very easy to
get unexpected results depending on how your spreadsheet is laid out.


--
HTH

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


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


"Anil_Indian" wrote in message
...
Dear
i m using excel logical functions for some calculation,
eg
=IF(AND(C2="EBRK",K2=1),0.0001,IF(AND(C2="EBRK",K2 1),J2/K2,IF(AND(F21,E21),0.0001,IF(AND(J2<-2000),0.0001,IF(AND(E2100000),1,IF(AND(K2=10000), 3,IF(AND(F21),2,(J2/K2)*4)))))))
but now i want to add some more logic but excel not allowes me.

plz tell me how i can add or simplyfy my formula





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

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