IF, OR, AND FUNCTION HELP

T

talltom

This is my actual formula.
=IF(OR(AND(D$25="GENERAL",D$25="THIEME"),($F$5*33)-(D$58+D$59)>0),($F$5*33)-(D$58+D$59),IF(OR(AND(D$25="EAGLE",D$25="GENIE",D$25="APACHE"),($F$5*28)-(D$58+D$59)>0),($F$5*28)-(D$58+D$59),0))

I need it to return 44 if D25=General or Thieme, and return 19 if Eagle,
Genie, or Apache.

Right now, it returns 44, regardless of what I put in D25.

D25=Genie, F5=5, D58=121, D59=0
It is calculating 5*33-121, and I need it to calculate 5*28-121

Any help would be greatly appreciated.
 
J

joeu2004

This is my actual formula.
=IF(OR(AND(D$25="GENERAL",D$25="THIEME"),($F$5*33)-(D$58+D$59)>0),
($F$5*33)­-(D$58+D$59),IF(OR(AND
(D$25="EAGLE",D$25="GENIE",D$25="APACHE"),($F$5*28)-(­D$58+D$59)>0),
($F$5*28)-(D$58+D$59),0))

I need it to return 44 if D25=General or Thieme, and return 19 if Eagle,
Genie, or Apache.

Right now, it returns 44, regardless of what I put in D25.

D25=Genie, F5=5, D58=121, D59=0
It is calculating 5*33-121, and I need it to calculate 5*28-121

Ostensibly, reverse the order of OR and AND. That is:

AND(OR(D$25="GENERAL",D$25="THIEME"),($F$5*33)-(D$58+D$59)>0)

However, I suspect the following simplification will work equally well
for you, and it might be easier to read and maintain:

=IF(OR(D$25="GENERAL",D$25="THIEME"), MAX(0, $F$5*33 - (D$58+D$59)),
IF(OR(D$25="EAGLE",D$25="GENIE",D$25="APACHE"),
MAX(0, $F$5*28 - (D$58+D$59)) , 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

Top