+ Reply to Thread
Results 1 to 14 of 14

Multiple Condition with Multiple Results

  1. #1
    Registered User
    Join Date
    09-03-2015
    Location
    anchorage, alaska
    MS-Off Ver
    I don't know
    Posts
    5

    Multiple Condition with Multiple Results

    Can someone please teach me how I would format a cell to do the following?:

    If A1 is 16-37, then B1 is .25
    If A1 is 38-52, then B1 is .50
    If A1 is 53-59, then B1 is .75
    If A1 is 60-75, then B1 is 1.00
    If A1 is 76-97, then B1 is 1.25
    If A1 is 98-112, then B1 is 1.50
    If A1 is 113-119, then B1 is 1.75
    If A1 is 120-157, then B1 is 2.00, etc.

    There would actually be 16 conditions so that the result would go up to 4.00.
    Ideally, the result would actually print in A1, but I don't think that's possible.


    Thanks in advance for anyone willing to respond.

  2. #2
    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
    52,946

    Re: Multiple Condition with Multiple Results

    Hi, welcome to the forum

    I would set this up in a small table (below), then use a VLOOKUP...
    A
    B
    C
    D
    2
    16
    0.25
    60
    3
    38
    0.50
    1
    4
    53
    0.75
    5
    60
    1.00
    6
    76
    1.25
    7
    98
    1.50
    8
    113
    1.75
    9
    120
    2.00

    D2= your value
    D3=VLOOKUP(D2,$A$2:$B$9,2,1)

    When you add your extra variables, just increace the range (bolded)
    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

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Multiple Condition with Multiple Results

    With this table in D1:E9
    Data Range
    D
    E
    1
    Floor
    Value
    2
    16
    0.25
    3
    38
    0.50
    4
    53
    0.75
    5
    60
    1.00
    6
    76
    1.25
    7
    98
    1.50
    8
    113
    1.75
    9
    120
    2.00

    These formulas both return the values you're looking for.
    Assume each increment is 0.25
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Multiple Condition with Multiple Results

    Hi, welcome to the forum.

    If you really, really want to work with just two cells, it is possible to do this with a nested IF statement, starting with your largest number, like this in B1:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    (I can't see a pattern in your A1 numbers, so I can't add the >X figures to go up further - put them at the start of the formula, with another closing bracket at the end for each IF you add.)

    However, I strongly suggest you go with one of the solutions above instead.

    Regards,
    Aardigspook

    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark Thread as Solved'.
    You don't need to give me rep if I helped, but thanks are appreciated.

  5. #5
    Forum Contributor
    Join Date
    01-11-2011
    Location
    Frederick, MD, USA
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Multiple Condition with Multiple Results

    An alternative strategy may work if you have a later version of Excel. Try using the following nested IF set in cell B1:

    Please Login or Register  to view this content.
    EDIT: Looks like Aardigspook beat me to it! Note that we took slightly different versions of the same idea. Also note that depending on the version of Excel you have, you might be limited to only 8 IF statements (later versions will allow up to 64).

  6. #6
    Registered User
    Join Date
    09-03-2015
    Location
    anchorage, alaska
    MS-Off Ver
    I don't know
    Posts
    5

    Re: Multiple Condition with Multiple Results

    Thanks! You guys rock. I'll try out your suggestions on a test spreadsheet. I am limited to 2 cells, so it looks like I'm going with the IF function. I sure do appreciate your fast responses.

  7. #7
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Multiple Condition with Multiple Results

    Do NOT go with the multiple nested IF formula.

    If you must use only the two cells, consider this:
    Please Login or Register  to view this content.
    Or...if the increments are always 0.25
    Please Login or Register  to view this content.
    The extra zeros are just placeholders for the other values that make up the list of 16.
    Last edited by Ron Coderre; 09-03-2015 at 04:33 PM.

  8. #8
    Registered User
    Join Date
    09-03-2015
    Location
    anchorage, alaska
    MS-Off Ver
    I don't know
    Posts
    5

    Re: Multiple Condition with Multiple Results

    Hi Ron. I don't doubt you, but may I ask why so I can learn?

  9. #9
    Registered User
    Join Date
    09-03-2015
    Location
    anchorage, alaska
    MS-Off Ver
    I don't know
    Posts
    5

    Re: Multiple Condition with Multiple Results

    Wanted to let you know I used the first IFERROR formula and it worked like a charm. Exactly what I needed. Thanks a million times over.

  10. #10
    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
    52,946

    Re: Multiple Condition with Multiple Results

    nested IF's can get very confusing to debug, and the longer/more involved they get, the harder it becomes to add to them.

    Is there a compelling reason why you cannot have a small table (which you can hide if you want)

  11. #11
    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
    52,946

    Re: Multiple Condition with Multiple Results

    nested IF's can get very confusing to debug, and the longer/more involved they get, the harder it becomes to add to them.

    Is there a compelling reason why you cannot have a small table (which you can hide if you want)

  12. #12
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Multiple Condition with Multiple Results

    Quote Originally Posted by Ron Coderre View Post
    Do NOT go with the multiple nested IF formula.
    Quote Originally Posted by dunerak View Post
    may I ask why so I can learn?
    Quote Originally Posted by FDibbins View Post
    nested IF's can get very confusing to debug, and the longer/more involved they get, the harder it becomes to add to them.
    I always forget about using arrays - the bits between the curly brackets {} - in formulae. Definitely go with Ron's formula not mine - it's a LOT better for the reasons given above.

    @Ron - thanks for the reminder, enjoy the rep.

    Regards,
    Aardigspook

    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark Thread as Solved'.
    You don't need to give me rep if I helped, but thanks are appreciated.

  13. #13
    Registered User
    Join Date
    09-03-2015
    Location
    anchorage, alaska
    MS-Off Ver
    I don't know
    Posts
    5

    Re: Multiple Condition with Multiple Results

    FD, I didn't know the table could be embedded, and since my familiarity with Excel is limited, it looked overwhelming. It is not my spreadsheet and I wanted to keep it as simple as possible so my associate would be willing to try it. Believe it or not, Ron's formula made sense to me in how it was constructed. And I am happy to report it is now being used in the spreadsheet and we are all quite happy with it. Thanks to everyone who shared their knowledge with me. Such a nice thing to do.

  14. #14
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Multiple Condition with Multiple Results

    Glad you got something you can use!

    If that resolves your issue, please take a moment to mark this thread as SOLVED (from the Thread Tools menu)

+ 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. [SOLVED] Return multiple Results from an IF statement if more than one condition exists
    By mysticmoron109 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-28-2015, 02:45 PM
  2. Replies: 1
    Last Post: 09-04-2014, 12:14 PM
  3. Multiple Search Criteria produces (list) Multiple results in a single cell
    By snake007uk in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-02-2014, 12:13 PM
  4. Find multiple values in multiple ranges and produce results in a list
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-07-2014, 02:11 AM
  5. Help getting multiple results from multiple criteria on multiple pages
    By ERaasio in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-03-2013, 07:29 PM
  6. Replies: 11
    Last Post: 02-07-2013, 02:22 AM
  7. Replies: 1
    Last Post: 12-25-2012, 05:32 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