+ Reply to Thread
Results 1 to 6 of 6

Value in e3 defines what value goes into q3,r3,s3.

Hybrid View

  1. #1
    Registered User
    Join Date
    07-17-2015
    Location
    Houston
    MS-Off Ver
    15.11.2
    Posts
    13

    Value in e3 defines what value goes into q3,r3,s3.

    e3 can only be a 1,2, or 3.
    If e3 =3 then q3,r3 and s3 will be 1.
    If e3 =1 then q3 will be 1 and r3 and s3 will be blank.
    If e3 =2 then q3 will be 1 and I will have to review to decide if r3 or s3 will have a 1.
    Except for e3=2 how do I write the IF statement?

    Thanks for your help........eugene

  2. #2
    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
    48,494

    Re: Value in e3 defines what value goes into q3,r3,s3.

    It's not one IF statement, it's three. One each for Q3, R3 and S3. Each will be a nested IF evaluating the value in E3.


    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


  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.96 for Mac MS 365
    Posts
    8,693

    Re: Value in e3 defines what value goes into q3,r3,s3.

    As Trevor noted, this requires three if statements. So far based on what you've written, put this in Q3 =IF(AND(E3>0,E3<4),1,"") and put this in both R3 and S3 =IF(E3=3,1,""). If you decide to do something else with E3 when it equals 2 for R3 and S3 to equal 1, you could adjust the first formula to be =IF(AND(E3>0,E3<3),1,"") in each R3 and S3. There are other options for if statements too, these are just a couple.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,049

    Re: Value in e3 defines what value goes into q3,r3,s3.

    Another option would be to put your variables/data into a small table, then use INDEX/MATCH...

    Q
    R
    S
    T
    3
    1
    1
    1
    4
    5
    6
    Q R S
    7
    1
    1
    8
    2
    1
    9
    3
    1
    1
    1

    Q3=INDEX(R$7:R$9,MATCH($E$3,$Q$7:$Q$9,0))
    copied across

    My only question is what to do for R and S if E3 = 2, you were not too clear on that
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    07-17-2015
    Location
    Houston
    MS-Off Ver
    15.11.2
    Posts
    13

    Re: Value in e3 defines what value goes into q3,r3,s3.

    Thanks for the help. The examples explained several things to me. As for E3=2 the answer is not currently within the spreadsheet but is being added.

  6. #6
    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
    48,494

    Re: Value in e3 defines what value goes into q3,r3,s3.

    You're welcome. Thanks for the rep.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. How to build a filter that defines what to remove, not what to retain:
    By Chad Bateman in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-26-2014, 01:40 PM
  2. How do I find the formula that defines a data table?
    By Goldbug in forum Excel General
    Replies: 1
    Last Post: 10-11-2011, 12:21 PM
  3. user input defines last row?
    By dgady in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-10-2011, 02:37 AM
  4. Macro that defines a range given timevalue in cell
    By Hjahren in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-26-2010, 03:00 AM
  5. Excel 2007 : Table lookup, row defines column to search in
    By lkkpederson in forum Excel General
    Replies: 8
    Last Post: 03-20-2010, 12:26 PM
  6. How to use name defines in SUMPRODUCT
    By pninja005 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-13-2006, 04:47 PM
  7. User Forms - Command Button defines value to be used later
    By Barb Reinhardt in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-18-2006, 06:00 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