+ Reply to Thread
Results 1 to 9 of 9

Combinbing 3 If statements isn't working

  1. #1
    Registered User
    Join Date
    11-10-2016
    Location
    Cleveland, OH
    MS-Off Ver
    2010
    Posts
    16

    Combinbing 3 If statements isn't working

    Hello. Need a hand here ...

    Three formulas work independent of each other; but when I combine them, they don't yield the results, I'm thinking it's because I'm adding "AND" in the middle equation:

    =IF(AF30<(DATE(YEAR(AQ1)+5,MONTH(AQ1),DAY(AQ1))),(AF30-(DATEVALUE("1/1/2017")))*V31)
    =IF(AND(AF30>=((DATE(YEAR(AQ1)+5,MONTH(AQ1),DAY(AQ1)))),(AF30<=((DATE(YEAR(AQ1)+10,MONTH(AQ1),DAY(AQ1)))))),(AF30-(DATEVALUE("1/1/2017")))*V32)
    =IF(AF30>((DATE(YEAR(AQ1)+10,MONTH(AQ1),DAY(AQ1)))),(AF30-(DATEVALUE("1/1/2017")))*V33)

    I combine the Three by removing the end parenthesis then add a comma:

    =ROUND(IF(AF30<(DATE(YEAR(AQ1)+5,MONTH(AQ1),DAY(AQ1))),(AF30-(DATEVALUE("1/1/2017")))*V31,(IF(AND(AF30>=((DATE(YEAR(AQ1)+5,MONTH(AQ1),DAY(AQ1)))),(AF30<=((DATE(YEAR(AQ1)+10,MONTH(AQ1),DAY(AQ1)))))),(AF30-(DATEVALUE("1/1/2017")))*V32),IF(AF30>((DATE(YEAR(AQ1)+10,MONTH(AQ1),DAY(AQ1)))),(AF30-(DATEVALUE("1/1/2017")))*V33))),0)

    Yield is #VALUE now.

    Trying to calculate daily accrual rate of vacation based upon a hire date(cell AQ1) vs current date (cell AF30), if over 5 years then daily accrual is 0.2, if over 10 years .3 if over 15 years .4 (which I have in cells V31, V32, V33)

    I'm stuck .....

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Combinbing 3 If statements isn't working

    Or you could use....

    Please Login or Register  to view this content.
    Last edited by pjwhitfield; 11-10-2016 at 12:29 PM.
    If someone has helped you then please add to their Reputation

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Combinbing 3 If statements isn't working

    Try this

    =(AF30-DATEVALUE("1/1/2017"))*IF(AF30>DATE(YEAR(AQ1)+10,MONTH(AQ1),DAY(AQ1)),V33,IF(AF30>DATE(YEAR(AQ1)+5,MONTH(AQ1),DAY(AQ1)),V32,V31))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Registered User
    Join Date
    11-10-2016
    Location
    Cleveland, OH
    MS-Off Ver
    2010
    Posts
    16

    Re: Combinbing 3 If statements isn't working

    Hey that works! Thanks Special-K !!!!

  5. #5
    Registered User
    Join Date
    11-10-2016
    Location
    Cleveland, OH
    MS-Off Ver
    2010
    Posts
    16

    Re: Combinbing 3 If statements isn't working

    That one works PJ! Thanks! But I don't want todays date to be auto-populated, I wanted that to be a user submitted date

  6. #6
    Registered User
    Join Date
    11-10-2016
    Location
    Cleveland, OH
    MS-Off Ver
    2010
    Posts
    16

    Question Re: Combinbing 3 If statements isn't working

    One more

    =(AF30-(DATEVALUE("1/1/2017")))*V31/2 yields the correct number value of 3.39714

    when I add ROUND to it, it yields: 38084

    =ROUND(AF30-(DATEVALUE("1/1/2017"))*V31/2,0)

    it should Round to 3.0

    WTF am I doing wrong ?!?!

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Combinbing 3 If statements isn't working

    Try

    =ROUND((AF30-(DATEVALUE("1/1/2017")))*V31/2,0)

  8. #8
    Registered User
    Join Date
    11-10-2016
    Location
    Cleveland, OH
    MS-Off Ver
    2010
    Posts
    16

    Re: Combinbing 3 If statements isn't working

    DUH.... Thanks !

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Combinbing 3 If statements isn't working

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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] VBA assistance with if statements not working
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-12-2016, 09:09 AM
  2. [SOLVED] IF,AND,OR statements not working
    By bhenlee in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-07-2015, 11:43 AM
  3. [SOLVED] Multiple IF Statements are working as I would like
    By NZL_Truly in forum Excel General
    Replies: 4
    Last Post: 02-15-2015, 02:20 AM
  4. [SOLVED] IF() statements not working out right
    By sumitos in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-22-2013, 12:37 AM
  5. IF statements not working
    By dissonance in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-15-2007, 09:56 AM
  6. Multiple IF THEN ELSE statements not working
    By johnnywinter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-04-2007, 08:14 PM
  7. working with IF statements
    By matty_g in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 09-06-2005, 03:05 AM

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