+ Reply to Thread
Results 1 to 12 of 12

Help with nested if statements for various ranges

  1. #1
    Registered User
    Join Date
    02-14-2013
    Location
    usa
    MS-Off Ver
    Excel 2007/2010
    Posts
    12

    Help with nested if statements for various ranges

    Hi,

    I needed some help with this range I needed to write a formula for. I saw that a formula or a vlookup range table can be set up so that these ranges can be changed without changing the formula. I'd really appreciate any help with the formula first, and the vlookup table setup would help as well.

    Here are the ranges:

    Aaa <0.75x
    Aa ≥0.75x - 1.5x
    A ≥1.5x - 2.5x
    Baa ≥2.5x - 3.5x
    Ba ≥3.5x - 4.5x
    B ≥4.5x - 6.0x
    Caa ≥6.0x - 8.0x
    Ca ≥8.0x [or <0.0x]


    Thanks

  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,929

    Re: Help with nested if statements for various ranges

    Hi and welcome to the forum

    i would suggest you upload a sample work book, (all sensitive data removed), showing what data you are working with, a few examples of what your expected outcome is, and how you arrived at that
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    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 dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Help with nested if statements for various ranges

    Hi ab585,

    welcome to the forum.
    Try using below formula:-

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    see attached:- Lookup in place of multiple IF.xlsx

    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  4. #4
    Registered User
    Join Date
    02-14-2013
    Location
    usa
    MS-Off Ver
    Excel 2007/2010
    Posts
    12

    Re: Help with nested if statements for various ranges

    I meant to put excel version 2007 which is the one I use.

    What would the nested if formula look like?

    Thanks Dilip

  5. #5
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Help with nested if statements for various ranges

    A mess. Use the lookup now the hard work has been done for you.
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  6. #6
    Registered User
    Join Date
    02-14-2013
    Location
    usa
    MS-Off Ver
    Excel 2007/2010
    Posts
    12

    Re: Help with nested if statements for various ranges

    The ranges look wrong Dilip, what about less than 0 and the range for B? Less than 0 should be Ca.

    5.83 is returning Ba it should return B.

    0-0.74 should be Aaa.
    Last edited by ab585; 02-14-2013 at 11:08 AM.

  7. #7
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Help with nested if statements for various ranges

    Use this corrected table:
    -9000000000, Ca
    0, Aaa
    0.75, Aa
    1.5, A
    2.5, Baa
    3.5, Ba
    4.5, B
    6, Caa
    8, Ca

  8. #8
    Registered User
    Join Date
    02-14-2013
    Location
    usa
    MS-Off Ver
    Excel 2007/2010
    Posts
    12

    Re: Help with nested if statements for various ranges

    Thans CC.

    Why is less than 0 -9000000000, Ca?

  9. #9
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Help with nested if statements for various ranges

    I guessed a large negative number which you would be unlikley to trip over. Strictly speaking this approach would give the wrong results for values less than -9000000000 (i.e. -9000000001 would not work). Based on your sample range being 9 orders of magnitude smaller I figured this was a safe threshold.

  10. #10
    Registered User
    Join Date
    02-14-2013
    Location
    usa
    MS-Off Ver
    Excel 2007/2010
    Posts
    12

    Re: Help with nested if statements for various ranges

    Thanks again CC.

    Lastly, to whomever can answer.

    I want to create a nested if formula for a 1 notch increase in 1 column and a 1 notch decrease in another for each grade.
    For example a score is 5.86, it's currently B. I want to make a column where it would show how much of an increase would make it Caa and in another column how much of a decrease would make it Ba.

    Would appreciate any help. Thanks.

  11. #11
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Help with nested if statements for various ranges

    For gap to next lower value:
    =LOOKUP(E1,H1:H9)-E1

    For gap up to next higher value:
    =INDEX(H1:H9,MATCH(E1,H1:H9)+1)-E1

    If you want the signs reversed, swap the calculated term with E1 around the -

  12. #12
    Registered User
    Join Date
    02-14-2013
    Location
    usa
    MS-Off Ver
    Excel 2007/2010
    Posts
    12

    Re: Help with nested if statements for various ranges

    Thanks CC.

+ 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