+ Reply to Thread
Results 1 to 9 of 9

complex if statement

  1. #1
    Registered User
    Join Date
    12-11-2015
    Location
    Idaho Falls, ID
    MS-Off Ver
    2010
    Posts
    5

    complex if statement

    I want to create an "if" statement evaluating two cells. One cell would have three different options. The second cell has a number to be evaluated by if statements. I want the result of the second cells evaluation be put in a third cell. The following formula works perfectly, with one exception: =CONCATENATE(IF(D3="STYLE A",IF(E3<19.735,19.375,IF(E3<22.375,22.375,IF(E3<25.375,25.375)))),IF(D3="SINGLE",IF(E3<22.375,22.375,IF(E3<25.375,25.375))),IF(D3="BAR",IF(E3<12,12,IF(E3<14,14,IF(E3<18,18,IF(E3<26,26,IF(E3<32,32,IF(E3<36,36,IF(E3<42,42))))))))). The result is the true/false to each part of the if statement. I just one the true answer.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: complex if statement

    Hi and welcome to the forum,

    Generally we find with these type of requests its easier for us to understand what you want if you can upload some representative examples covering all permutations in a workbook and manually add the results you expect. In a narrative form explain the rules your are applying to get the results. Sometimes we can find more efficient methods but we need to understand the goal.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    12-11-2015
    Location
    Idaho Falls, ID
    MS-Off Ver
    2010
    Posts
    5

    Re: complex if statement

    That makes so much sense. The attached excel file is what I am working with. Essential what I want is a result based on limitations of a real life product. If a particular VT profile is chosen (D3) and a width is given (E3), I want to know what width I have to have to order to accommodate the required width. For example if Style A is chosen and the width is 25, I want 25.375 in the resultant cell. Or if Bar is chosen and the width is 13, I want a result of 14.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    12-11-2015
    Location
    Idaho Falls, ID
    MS-Off Ver
    2010
    Posts
    5

    Re: complex if statement

    The "if" statements for each type work individually, but I don't know how to add the complexity of an additional requirement. The result in the above formula is compounded for each part. Because of the CONCATENATE function, the result of all three if formulas are displayed. I only want the result of the true statement. If it is style a, then 19.375, 22.375, etc. or if single, then, 22.375 or 25.375 or if bar, then...

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: complex if statement

    Hi,

    But what's the relationship between the Style and Width that results in the examples you give. i.e. how does a Style A and a Width of 25 result in 25.375, and how does BAR and a width of 13 translate to 14? i.e what are the calculations you are making?

    Is there a lookup table we need to understand?

  6. #6
    Registered User
    Join Date
    12-11-2015
    Location
    Idaho Falls, ID
    MS-Off Ver
    2010
    Posts
    5

    Re: complex if statement

    It's not a calculation. The attached is specification for one type of countertop. Not all countertops are the excat dimensions of the give specifications. I can order a bigger countertop than needed and cut it down. I want to be able to input the desired size and have the result tell me which one I need base on the style.
    Attached Files Attached Files

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: complex if statement

    Quote Originally Posted by young_eeyore View Post
    It's not a calculation.
    That's why I asked you if a lookup table is involved - and from your pdf it seems there is.

    You need to build a LOOKUP Table. List the styles down a table of rows and the widths in ascending order across the columns, (e.g. 18, 21, 24 etc,) then in the matrix of cells add the results, e.g. 19.375, 22.375, 25.375.

    Then you can use an
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    formula.


    StyleA

  8. #8
    Registered User
    Join Date
    12-11-2015
    Location
    Idaho Falls, ID
    MS-Off Ver
    2010
    Posts
    5

    Re: complex if statement

    I guess my "if" statement is to complex. I'll have to see if I can figure out what data is needed in the LOOKUP table to give me the results I want.

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: complex if statement

    Quote Originally Posted by young_eeyore View Post
    I guess my "if" statement is to complex. .
    ...Indeed. That's often the case. If you find yourself adding more than five or six IF statements, then is the time to consider better options. The better option is usually a lookup table or, as in this case probably a lookup matrix for an INDEX(MATCH()) combination.

+ 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. Need Help with Complex If Statement (for me anyway)
    By Nelmagene in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-27-2015, 05:54 PM
  2. [SOLVED] Help with complex If statement please
    By TimJ79 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-09-2014, 12:35 PM
  3. [SOLVED] Complex IF AND OR statement
    By amack05 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-09-2012, 11:09 AM
  4. Complex IF Statement?
    By BadBrick in forum Excel General
    Replies: 14
    Last Post: 04-08-2012, 12:12 PM
  5. Complex IF Statement
    By rhudgins in forum Excel General
    Replies: 1
    Last Post: 03-14-2011, 06:15 PM
  6. Complex If Statement
    By robert_shindorf in forum Excel General
    Replies: 33
    Last Post: 12-12-2008, 09:08 PM
  7. Complex IF Statement
    By brooke1416 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-06-2008, 12:24 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