+ Reply to Thread
Results 1 to 4 of 4

Combine 2 if statements

  1. #1
    Forum Contributor
    Join Date
    07-21-2013
    Location
    washington dc
    MS-Off Ver
    365 MSO
    Posts
    473

    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. #2
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    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
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  3. #3
    Forum Contributor
    Join Date
    07-21-2013
    Location
    washington dc
    MS-Off Ver
    365 MSO
    Posts
    473

    Re: Combine 2 if statements

    thank you that worked

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,093

    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
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to Combine 2 If statements
    By cartica in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-21-2014, 02:44 PM
  2. Four IF statements to combine
    By ABSTRAKTUS in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-29-2014, 03:43 PM
  3. [SOLVED] Need help to combine to VBA Statements
    By SamCV in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-06-2013, 02:01 PM
  4. Need to combine 20 IF statements
    By CatMac in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-06-2013, 04:58 AM
  5. Combine 2 If statements
    By m1066189 in forum Excel General
    Replies: 2
    Last Post: 06-23-2010, 07:58 PM

Bookmarks

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