+ Reply to Thread
Results 1 to 6 of 6

If statement - 3 conditions

  1. #1
    Registered User
    Join Date
    02-04-2014
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    23

    If statement - 3 conditions

    I don't think it is too complex but I have been struggling with this. I have 3 columns:


    A1 = ID
    A2 = ID Name
    A3 is where the If statement will go

    I need A3 to display as - If A1 equals “1” then A3 should say “Harvard”. If A1 equals “2” then A3 should say “MIT”. If A1 equals “3” then A3 should say whatever is in A2.

    Thank you.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: If statement - 3 conditions

    Try this:

    =CHOOSE(A1,"Harvard","MIT",A2)

    Are you still using Excel 2007???
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    02-04-2014
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: If statement - 3 conditions

    I botched my question. It is not A1, A2, A1. It is A1, B1, C1.

    The A1 field has the ID#'s (1001, 1002, 1003, etc) as the records
    B1 has the names associated with those ID's (Harvard, MIT, etc.)
    C1 is where the outcome of the IF statment will be

    The first two ID's can have different descriptions (e.g. 1001 can say "Harvard" or "Harvard University").

    I need a statement in C1 that says:
    If A1 = 1001 then "Harvard". If A1 = 1002 then "MIT", If A1 is anything other than 1001 or 1002 then pull in whatever is in B1.

    Thank you.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,147

    Re: If statement - 3 conditions

    =IF(A1=1001,"Havard",IF(A1=1002,"MIT",B1))

  5. #5
    Registered User
    Join Date
    02-04-2014
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: If statement - 3 conditions

    Quote Originally Posted by JohnTopley View Post
    =IF(A1=1001,"Havard",IF(A1=1002,"MIT",B1))
    Thank you!

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,147

    Re: If statement - 3 conditions

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. IF Statement for more than one conditions
    By sansan88 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-22-2021, 01:14 PM
  2. Replies: 2
    Last Post: 07-09-2015, 04:25 PM
  3. Using if statement with two conditions
    By fionn_ in forum Excel General
    Replies: 5
    Last Post: 07-03-2012, 09:43 AM
  4. @if statement with several conditions
    By grettagirl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2012, 12:52 PM
  5. VBA conditions if statement not met?
    By kaaver in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2010, 11:40 AM
  6. if statement with conditions
    By maacmaac in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-09-2009, 08:38 PM
  7. Replies: 3
    Last Post: 06-26-2005, 10:05 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