+ Reply to Thread
Results 1 to 7 of 7

Nested If statement formula not working for range of values

  1. #1
    Registered User
    Join Date
    02-09-2018
    Location
    Kansas
    MS-Off Ver
    2016
    Posts
    6

    Nested If statement formula not working for range of values

    Hello - I am trying to figure out the formula for a payroll related item - i have tried several and cannot get them to work right. Basically, the value in a certain cell (let's say A1) will determine what amount of extra hourly pay someone gets. And, the logical test is a range. For example, if the value in A1 is 22% or lower, the bonus is $2.00. If the value in A1 is between 23 and 26%, the bonus is $1.50. And so on. Each logical test is a range that determines the bonus. Here is the bonus structure:

    Bonus Pay

    36% & over no bonus ($0)
    31% to 35% $0.50
    27% to 30% $1.00
    23% to 26% $1.50
    up to 22% $2.00

    Anyone have the right formula for me? Thanks!!

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Nested If statement formula not working for range of values

    Try this...

    Data Range
    A
    B
    C
    D
    E
    1
    28%
    $1.00
    B1:=LOOKUP(A1,$D$1:$E$5)
    0%
    $2.00
    2
    23%
    $1.50
    3
    27%
    $1.00
    4
    31%
    $0.50
    5
    36%
    $0.00
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    02-09-2018
    Location
    Kansas
    MS-Off Ver
    2016
    Posts
    6

    Re: Nested If statement formula not working for range of values

    Thank you, I'll give it a try. I was trying to tell it in the formula instead of a lookup, but let me try what you have!

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Nested If statement formula not working for range of values

    If you want to have it inside the formula instead of referencing a table...

    =LOOKUP(A1,{0;0.23;0.27;0.31;0.36},{2;1.5;1;0.5;0})

    or

    =IF(A1>=0.36,0,IF(A1>=0.31,0.5,IF(A1>=0.27,1,IF(A1>=0.23,1.5,IF(A1>=0,2,"")))))
    Last edited by jeffreybrown; 02-09-2018 at 07:09 PM.

  5. #5
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Nested If statement formula not working for range of values

    Or going lowest threshold to highest:
    =IF(A1<23%,2,IF(A1<27%,1.5,IF(A1<31%,1,IF(A1<36%,0.5,0))))
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  6. #6
    Registered User
    Join Date
    02-09-2018
    Location
    Kansas
    MS-Off Ver
    2016
    Posts
    6

    Re: Nested If statement formula not working for range of values

    So that's what I did, but it didn't work for me. I used your formula above, which was almost identical to mine, and I think it worked. I'll plug in some new data and make sure. Thank you so much!

  7. #7
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Nested If statement formula not working for range of values

    You're most welcome! Upon conclusion, please mark your thread as SOLVED (Thread Tools above post #1). And since you're new...
    Clicking the Add Reputation star below helpful posts is a nice way to show appreciation to those who contributed. Regards - Lee
    Last edited by leelnich; 02-11-2018 at 08:39 PM.

+ 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] Nested IF statement not working
    By bibu in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-26-2015, 01:26 PM
  2. [SOLVED] Nested if statement not working
    By bryden2008 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-27-2015, 09:15 PM
  3. [SOLVED] Nested IF statement not working
    By Markjoyous in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-11-2014, 12:25 PM
  4. [SOLVED] Nested if statement not working
    By crsport3 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-08-2014, 07:12 PM
  5. [SOLVED] Nested If statement not working
    By hornet7 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-08-2013, 01:31 PM
  6. [SOLVED] Can't get nested Loop to copy range values from 2 tables working correctly
    By gtol in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2013, 12:01 PM
  7. nested IF statement not working
    By piquet2759 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-13-2009, 07:03 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