×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

IF Statement

IF Statement

IF Statement

(OP)
I am trying to write an 'IF Statement' where I9 is the variable ranging from 0 to 5000.

R9 and S9 return a different answer depending on the figure I9 returns.

Currently if I9 is '0' R9 and S9 default to 0.20 due to the formula in R9 and S9 respectively.

If I9 is equal to 0 I want I9 to show a 0 and not the 0.20 it currently is.

The formula I currently am using is:

=IF(I9>1500,S9,R9)

RE: IF Statement

Quote:

If I9 is equal to 0 I want I9 to show a 0 and not the 0.20 it currently is.

This doesn't make any sense.  If I9 = 0 then I9 is 0, not 0.2.

RE: IF Statement

(OP)
REVISED...

I am trying to write an 'IF Statement' where I9 is the variable ranging from 0 to 5000.

R9 and S9 return a different answer depending on the figure I9 returns.

Currently if I9 is '0' R9 and S9 default to 0.20 due to the formula in R9 and S9 respectively.

If I9 is equal to 0 I want X9 to show a 0 and not the 0.20 it currently is.

The formula I currently am using is:

=IF(I9>1500,S9,R9)

the formula I devised, but not seem to work:

=IF(AND(I9>0,I9<1500,R9,IF(I9>1500,S9,0)))

RE: IF Statement

Unless I'm totally misreading your intention, you have a very simple nested if.  The first check is to see if I9=0.  If I9=0, you want the formula result to be 0.  Therefore you begin with:

=IF(I9=0,0

If I9 is not 0, you want your original IF statement to apply.  Therefore, you get:

=IF(I9=0,0,IF(I9>1500,S9,R9))

RE: IF Statement

(OP)
RESULT... many thanks

these things are easier than you think!

RE: IF Statement

You were closer than you think - all you needed to do was close the logical 'AND' with a right hand parenthesis before telling X9 to display the contents of R9.  Then remove the third right hand parenthesis at the end.

=IF(AND(I9>0,I9<1500),R9,IF(I9>1500,S9,0))

I think that the number of right hand parentheses at the end of the 'IF' formula needs to be the same as the number of IF's in the formula.



Norm

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources