+ Reply to Thread
Results 1 to 6 of 6

If statement between numbers

  1. #1
    Registered User
    Join Date
    08-23-2018
    Location
    Houston, Texas
    MS-Off Ver
    2013 pro plus
    Posts
    73

    If statement between numbers

    Hi guys,

    Trying to figure out what I am doing wrong here. I am trying to had a % increase depending on if a number is between a set. My formula keep solving only my first If statement i have nested. What am i doing wrong? attached the file . Thanks guys
    Attached Files Attached Files

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.85 for Mac MS 365
    Posts
    8,519

    Re: If statement between numbers

    For one thing, get rid of the quotes around the numbers, make "1500" just 1500, same as the rest. Putting quotes around them changes them to text.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.85 for Mac MS 365
    Posts
    8,519

    Re: If statement between numbers

    Next, I would reverse the order of your if statement, from =IF(A3< 1500,S3+2%,IF(A3< 1000,S3+2.5%,IF(A3< 750,S3+3%,IF(A3< 500,S3+5%,IF(A3< 250,S3+8%,S3)))))

    To =IF(A3< 250,S3+8%,IF(A3< 500,S3+5%,IF(A3< 750,S3+3%,IF(A3< 1000,S3+2.5%,IF(A3< 1500,S3+2%,S3)))))
    for an IF THEN statement, the first value it finds that completes the argument will end the statement so 500 is less than 1500 so if it finds 25 first it will apply the S3+2% to it because it is less than 1500.

  4. #4
    Forum Contributor
    Join Date
    10-30-2014
    Location
    England
    MS-Off Ver
    2007 / 365
    Posts
    279

    Re: If statement between numbers

    In addition to Sambo kid's post, you need to reverse the order of numbers. As you are using a less than comparison you need to work from the lowest number upwards. For example, your first comparison is 'A3 less than 1500', and your last comparison is 'A3 less than 250', but all numbers less than 250 are also less than 1500. Also, you don't need to include S3+ in every result, just add it at the very start of the formula and then the appropriate result will be added to it.
    You might also want to look at using an IFS function instead of nested IF functions just to cut down on the length.

  5. #5
    Registered User
    Join Date
    08-23-2018
    Location
    Houston, Texas
    MS-Off Ver
    2013 pro plus
    Posts
    73

    Re: If statement between numbers

    Thanks guys! much appreciated!

  6. #6
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.85 for Mac MS 365
    Posts
    8,519

    Re: If statement between numbers

    If that solves your issue please mark the post as solved using the thread tools drop down at the top of the post. AND reps are always appreciated.

+ 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] Using letters instead of numbers in an 'if' statement?
    By natbat78 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-20-2014, 10:21 AM
  2. If statement - percentages and numbers
    By milo1984 in forum Excel General
    Replies: 1
    Last Post: 03-24-2014, 07:41 AM
  3. If statement help with numbers
    By cobydobbs in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-27-2013, 05:00 PM
  4. IF statement: using bigger of two numbers
    By Lizabeta in forum Excel General
    Replies: 4
    Last Post: 07-08-2009, 06:53 PM
  5. IF statement with range of numbers?
    By AlmostAGeek in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-18-2007, 11:02 PM
  6. IF statement for range of numbers
    By PBROW in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-04-2007, 02:35 PM
  7. Replies: 10
    Last Post: 01-09-2006, 06:40 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