+ Reply to Thread
Results 1 to 7 of 7

Nested If function returning FALSE instead of number

  1. #1
    Registered User
    Join Date
    12-09-2015
    Location
    california
    MS-Off Ver
    2010
    Posts
    4

    Nested If function returning FALSE instead of number

    Hello,
    The following if function is not working in a Salary and benefit spreadsheet I am working on to determine if someone is eligible for management leave pay. We also have two types of management leave pay based on when you were hired. The formula I wrote is trying to determine first if you are not management then return 0. the second portion of the formula states if you are management and hired after a specific date then calculate management leave pay and the last portion of the formula is to calculate management leave pay if you were hired before the specific date. When I use this formula I am getting a return value of FALSE instead of the management leave pay amount I need to have calculated. Can someone please tell me where the formula is wrong? I am kind of rusty, just got back to work from a long maternity leave where I didn't look at a computer more than 5 times. Thanks in advance for the help!

    =IF(DATABASE!AG22="",0,IF(DATABASE!AG22="Y"&DATABASE!AQ22="Y",((AI22/26/80)*100),IF(DATABASE!AG22="Y"&DATABASE!AQ22="N",((AI22*0.04)-1500)+((AI22/26/80)*72))))

    The database sheet it is referring to is where the calculation determining if you are management, and what your hire date was.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,714

    Re: Nested If function returning FALSE instead of number

    You don't use the ampersand symbol & to denote logical AND - use the AND function instead (& is used to join two strings together). Your formula should be along these lines:

    =IF(DATABASE!AG22="",0,IF(AND(DATABASE!AG22="Y",DATABASE!AQ22="Y"),AI22/26/80*100,IF(AND(DATABASE!AG22="Y",DATABASE!AQ22="N"),AI22*0.04-1500+AI22/26/80*72,"condition_1"),"condition_2"))

    There are two other conditions you have not accounted for, i.e. N Y and N N, so that is why you are getting FALSE.

    Hope this helps.

    Pete

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Nested If function returning FALSE instead of number

    This is not a valid AND expression
    DATABASE!AG22="Y"&DATABASE!AQ22="Y"

    Should be
    AND(DATABASE!AG22="Y",DATABASE!AQ22="Y")

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Nested If function returning FALSE instead of number

    Maybe:

    =IF(DATABASE!AG22="",0,IF(DATABASE!AG22="Y",IF(DATABASE!AQ22="Y",(AI22/26/80)*100,
    IF(DATABASE!AQ22="N",AI22*0.04-1500+(AI22/26/80)*72))))

    Note: it returns FALSE with AG22<>"Y" or AQ22<>"N". What do you expect FALSE to be with those criterias, or just leave it as FALSE??
    Quang PT

  5. #5
    Registered User
    Join Date
    12-09-2015
    Location
    california
    MS-Off Ver
    2010
    Posts
    4

    Re: Nested If function returning FALSE instead of number

    Thanks for the help Pete! There won't be a condition N N or N Y, the cells are all blank except for manual input of Y into cells in the column DATABASE!AG for management employees. from there the second column would have Y or N so the only conditions we would see are a blank cell in AG, Y in AG and N in AQ or Y in AG and Y in AQ.

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Nested If function returning FALSE instead of number

    So, does it work and which one?

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,714

    Re: Nested If function returning FALSE instead of number

    Okay, in my formula just put zero instead of "condition_1" and "condition_2".

    Hope this helps.

    Pete

+ 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. IF AND ISNUMBER SEARCH Function. Keeps returning false value even if true.
    By joshuarobbins in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-05-2019, 02:53 AM
  2. Nested IF Returning False - Need to Return True for Three Scenarios
    By rhelmer in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-18-2015, 05:50 PM
  3. [SOLVED] Nested IF statements are returning FALSE values - cannot find error in code!
    By apex_chio in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-03-2013, 11:01 PM
  4. Nested IF returning FALSE value help
    By crash884 in forum Excel General
    Replies: 3
    Last Post: 08-13-2013, 01:31 PM
  5. Logical test in IF function returning TRUE when it should be FALSE
    By lvjeff in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-28-2012, 05:13 PM
  6. Replies: 5
    Last Post: 06-15-2010, 10:51 AM
  7. if function returning false instead of my selection
    By kelleybr in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-27-2006, 03:23 PM

Tags for this Thread

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