+ Reply to Thread
Results 1 to 9 of 9

Multiple IF statments?

  1. #1
    Registered User
    Join Date
    03-26-2009
    Location
    Big Town, Texas
    MS-Off Ver
    Excel 2003
    Posts
    47

    Multiple IF statments?

    Is there a way to write a single formula that will take into account multiple rules? Basically, say I have a value in cell A1 that is 17% and I want to write a formula that takes into account the following things:

    If A1 is >80% = 0
    If A1 is between 50-79.99% = 25
    If A1 is between 25-49.99% = 50
    If A1 is between 0-24.99 = 75%

    So the formula would produce the number 75%, since the value in A1 is 17%.

    Is there a way to write that into one formula, perhaps with multiple IF and OR statements? I'm not really sure how I can string those together. Any help is much appreciated.

  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
    44,440

    Re: Multiple IF statments?

    If A1 is >80% = 0
    If A1 is between 50-79.99% = 25
    If A1 is between 25-49.99% = 50
    If A1 is between 0-24.99 = 75%

    Try:

    =IF(A1>80%,0,IF(A1>=50%,25,IF(A1>=25%,50,75)))


    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 Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,883

    Re: Multiple IF statments?

    Try this:

    =if(and(A1>0,A1<.25),.75,if(and(A1>=.25,A1<.5),.5,if(A1>=.5,A1<=.8),.25,0)))
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    03-26-2009
    Location
    Big Town, Texas
    MS-Off Ver
    Excel 2003
    Posts
    47

    Re: Multiple IF statments?

    I keep getting the "You've entered too many arguments for this function" error, and then it highlights the last number in the formula. Do you have any idea why that might be?

  5. #5
    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
    44,440

    Re: Multiple IF statments?

    For which formula? They both do much the same, just in a slightly different way.

    Regards, TMS

  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
    44,440

    Re: Multiple IF statments?

    Probably the second one:

    =if(and(A1>0,A1<.25),.75,if(and(A1>=.25,A1<.5),.5,if(AND(A1>=.5,A1<=.8),.25,0)))


    Regards, TMS

  7. #7
    Registered User
    Join Date
    03-26-2009
    Location
    Big Town, Texas
    MS-Off Ver
    Excel 2003
    Posts
    47

    Re: Multiple IF statments?

    You guys rock. Thanks a bunch.

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,883

    Re: Multiple IF statments?

    Thanks Trevor. Missed the last And operation.

    Alan

  9. #9
    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
    44,440

    Re: Multiple IF statments?

    @Alan: no problem. It's good practice playing spot the deliberate mistake

    @gballard: you're welcome.


    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)

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