# Combine 2 if statements

1. ## Combine 2 if statements

Hi-

How can I combine both of below. Thanks

``Please Login or Register  to view this content.``
``Please Login or Register  to view this content.``
Thanks

2. ## Re: Combine 2 if statements

=IF(B2="Merrill-CW14 MSCI Daily TR", "Merrill Lynch Intl + CO.",IF(B2="Jollibee Foods Corporation", "Jollibee Foods Corp",B2))

Untested.

=IF(logical_test,value_if_true,value_if_false)

logical_test: This is where you put the test. The rest can be any statement that results in a True or False result, for example A1>15. If A1 is in fact larger than 15, the result will be True. Common operators would be
.
• ">" Greater Than
• "<" Less Than
• "<>" NOT equal to
• ">=" Greater than or equal to
• "<=" Less than or equal to
• "=" Equal to

value_if_true: This is the result if logical_test returns a TRUE value.
value_if_false: As you probably guessed, this is the result if logical test returns a FALSE value.

A full example of the formula would be:

=IF(A1=10,A1+10,B1)

Now, if cell A1 is equal to 10, the result of the formula will be 20. Why? Because if A1=10, the value_if_true will occur, resulting in 10+10
If A1 is NOT equal to 10, the result of the formula will be whatever the value of B1's cell is

Remember, any one of the three inputs for the IF function can be another formula, for example, here are two IF's nested:
=IF(A1=10,A1+10,IF(A1>10,A1,B1-10))
The value_if_false is another IF function, that will only be executed by Excel if the previous IF statement (A1=10) is False

3. ## Re: Combine 2 if statements

thank you that worked

4. ## Re: Combine 2 if statements

Doesn't look very scaleable. You'd be better off with a lookup table. A couple of options ...

 A B C D 1 2 Merrill-CW14 MSCI Daily TR Merrill Lynch Intl + CO. =IFERROR(CHOOSE(MATCH(\$B\$2,{"Merrill-CW14 MSCI Daily TR","Jollibee Foods Corp"},0),"Merrill Lynch Intl + CO.","Jollibee Foods Corporation"),"not found") 3 Merrill Lynch Intl + CO. =IFERROR(VLOOKUP(\$B\$2,B7:C9,2,0),"not found") 4 5 6 7 Search Alternative 8 Merrill-CW14 MSCI Daily TR Merrill Lynch Intl + CO. 9 Jollibee Foods Corporation Jollibee Foods Corp 10

Regards, TMS

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1