+ Reply to Thread
Results 1 to 4 of 4

If, Then Statement With Three Choices

  1. #1
    Registered User
    Join Date
    11-07-2014
    Location
    Philadelphia, PA
    MS-Off Ver
    2013
    Posts
    2

    If, Then Statement With Three Choices

    SOLVED


    Hello,

    I wanted to first thank everyone for this website and help. I have used it many times in the past to answer some questions (some common and others unique).

    I had a question regarding what I think is an If-Then scenario.

    Scenario:

    I am working on a rather large worksheet that contains close to 20 columns of information and close to 22,000 rows. At one part I have 4 columns of data that each contain different sets of numbers.

    Example:

    Column 1 = 6
    Column 2 = 7
    Column 3 = -1
    Column 4 = (blank)

    Column 3 = Column 1 - Column 2. Now my problem is, for column 4, I need a certain number to autofill depending on the number in column 3.

    Here are the rules:
    1) If Column 3 is less than or equal to -3, I need column 4 to auto populate the number 1.
    2) If Column 3 is either -2, -1, or 0, it needs to auto populate the number 3.
    3) If Column 3 is greater than 0, I need it to auto populate the number 5.

    If I need to provide any more information, I will be happy to help.

    Thank you!
    Last edited by Recon231; 01-16-2015 at 03:48 PM.

  2. #2
    Registered User
    Join Date
    11-07-2014
    Location
    Philadelphia, PA
    MS-Off Ver
    2013
    Posts
    2

    Re: If, Then Statement With Three Choices

    Of course right when I post it, I figure it out.

    I used:

    =IF(A3<=-3,1,IF(A3<=0,3,IF(A3>0,5,-1)))

    haha.

    Thanks!

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: If, Then Statement With Three Choices

    Hi Recon,

    Welcome to the Forum!

    Try:

    Please Login or Register  to view this content.
    If you haven't used macros before you'll need to go to your options - trust center -trust center settings - macro settings
    , the second option down (disable all macros with notification)

    Then - Copy the code to the clipboard

    Open your Workbook

    Press ALT + F11 to open the Visual Basic Editor.

    Select "Module" from the Insert menu

    Type "Option Explicit" then paste the code under it

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: If, Then Statement With Three Choices

    Something like this?

    Please Login or Register  to view this content.
    Spread the love, add to the Rep

    "None of us are as smart as all of us."

+ 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 with multiple cell choices
    By danielhibbswoodings in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-09-2014, 10:23 AM
  2. If Statement with Choices
    By ktkreeger in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-16-2013, 04:20 PM
  3. Drop-down list choices restricting choices of other lists?
    By not_quite_excelling in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-25-2011, 06:04 AM
  4. [SOLVED] CREATE AN "IF' STATEMENT FOR CHOICES OF CHECK BOXES
    By pjb in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-08-2006, 04:10 PM
  5. Include several choices in an IF statement.
    By kevin in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-12-2005, 08:06 AM

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