Thanks:  0
Likes:  0

# Thread: Is there any better way to set out multiple IF statements?

1. Cos i am using a formula with about 4 If statements in it, and i am finding it hard to read and it is getting quite confusing. :|
Thanx

2. Yes

Check Help on boolean, Vlookup, HLookup, Lookup, Choose, etc.

3. Try using the OR function

4. "If" statements can get very confusing and
hard to read, that's why the "real guys"
suggest using "select case" you may want to
it.

James

5. Select Case is only available in VBA but not in the Excel application.

6. So how do you write a formula using the VBA instead of the formula box?

7. On 2002-04-13 22:33, KnAsTa wrote:
So how do you write a formula using the VBA instead of the formula box?
Hi,

Please show us your formula (or describe in detail what you'd like to do).

Thanks,
Jay

8. if you have multiple conditions and you want to use if statements. the best way is to use.

Select Case testexpression
[Case expressionlist-n
[statements-n]] ...
[Case Else
[elsestatements]]

End Select

you can see the how select statement can be used by taking on line help also

this is the best way to go.

ni****h desai
http://www.pexcel.com

9. =IF(ISERROR(LOOKUP(A5,week1.xls!\$A\$1:\$A\$10,0)),IF(VLOOKUP(A5,week1.xls!\$A\$1:\$D\$10,3,0)>VLOOKUP(A5,week1.xls!\$A\$1:\$D\$10,4,0),3,0),IF(ISNA(LOOKUP(A5,week1.xls!\$A\$1:\$D\$10,4)>VLOOKUP(A5,week1.xls!\$A\$1:\$D\$10,3,0)),3,0))

Thats the formula using 3 IF statements.
Confusing?

10. There are people you use boolean by multiplications and additions and returns the values..

one is i suppose from arnold site.. where he has explained how to use without 'IF'

i have have downloaded his sample file where he has given the example ..

http://geocities.com/aaronblood

ni****h desai
http://www.pexcel.com

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•