+ Reply to Thread
Results 1 to 11 of 11

If statement with 2 reasons

  1. #1
    Registered User
    Join Date
    12-15-2006
    Posts
    66

    If statement with 2 reasons

    I would like to construct an if statement that is If cell A2=stop return x, if A2 =go return y, if A2=bold return z (this would have 9 ifs). The only exception would be if B2=Folly then A2=stop return b, if A2 =go return c etc. I have these values on a seperate sheet if that helps in column F & H. Thanks

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    Post a sample of ur sheet, including the value table.

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    You could do this most easily with some sort of LOOKUP formula, e.g. if your separate sheet is called data and you have your 9 possible values for A2 in E1:E9 (stop,go etc.) and the corresponding values to be returned in F1:F9 [ or alternative values when B2=Folly in H1:H9]

    Then you can use the formula

    =VLOOKUP(A2,data!E1:H9,If(B2="Folly",4,2),0)

  4. #4
    Registered User
    Join Date
    12-15-2006
    Posts
    66
    Does this help BigBas? Thanks
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    It is very hard to follow the example the you posted. Im not sure how sheet 1 relates to sheet 2 at all. I have set up a sample of one of the methods of doing it. Obviosuly, you will have to adjust the values to suit.

    Your list is on the LIST page, and you enter your values on the entry page.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    12-15-2006
    Posts
    66
    BigBas, your patience is much appreciated. It looks great except when it finds the word "folly" in column B on the entry list it should return the values in a different column from the list sheet. So in this revised example if on the list page in column C there was a B in C2, a C in C3 and a D in C4 if the word folly is in column B those values or letters would be returned. So in the example you sent me on the entry page C5 would read B, C6 would read C and C7 would read D. Thanks in advance

  7. #7
    Registered User
    Join Date
    12-15-2006
    Posts
    66
    BigBas, the only time those other values/words should be returned in when folly is in the cooresponding row in column B.

  8. #8
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256

    Solution

    This solves the problem above.
    //Ola

    I increased the table size to from 2 to 3 columns and added the logic below:
    (B5="folly") -->False, 1*False -->0
    (B7="folly") -->True, 1*True -->1
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    12-15-2006
    Posts
    66
    Incredible, thanks to all!!!!!

  10. #10
    Registered User
    Join Date
    12-15-2006
    Posts
    66
    Okay, now I need to push the envelope. How about if I wanted to add that if "cat" and "dog" are in column C on the entry page they would also reference column D on the list page. I tried many options but could make no headway. Thanks

  11. #11
    Registered User
    Join Date
    12-15-2006
    Posts
    66
    I kept pushing and finally figured it out +1(c2="cat") etc does it. Once again thanks to all!!!!!!!!!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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