+ Reply to Thread
Results 1 to 4 of 4

IF Formula not working...

  1. #1
    Registered User
    Join Date
    07-19-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2008 Mac
    Posts
    3

    IF Formula not working...

    Hi folks, im new to this forum, so apologies if im not posting this in the right place… I am attempting to write an IF formula that will calculate staff holiday entitlements for me. Entitlements are based on date of joining company (B5), contracted hours (B3) and number of Bank Holidays in the year (B7). I've attempted the following formula:

    =IF(B5<=DATE(1992,3,31),SUM(((B3/5)*29))+((B3/5)*B7)),IF(AND(B5>=DATE(1992,4,1),B5<=DATE(2002,3,31),SUM(((B3/5)*27))+((B3/5)*B7)),IF(AND(B5>=DATE(2002,4,1),B5<=DATE(2007,3,31),SUM(((B3/5)*25))+((B3/5)*B7)),IF(AND(B5>=DATE(2007,4,1),B5<=DATE(2009,4,31),SUM(((B3/5)*24))+((B3/5)*B7)),IF(B5>=DATE(2009,5,1),SUM(((B3/5)*21))+((B3/5)*B7),"ZERO"))))

    This formula returns a VALUE! error message.

    Can anyone help me correct this formula? any advice, much approciated…

    Thanks!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: IF Formula not working...

    Each of your AND() scenarios is missing its closing paren....

    Maybe this:

    =IF(B5<=DATE(1992,3,31),((B3/5)*29)+((B3/5)*B7),
    IF(AND(B5>=DATE(1992,4,1),B5<=DATE(2002,3,31)),((B3/5)*27)+((B3/5)*B7),
    IF(AND(B5>=DATE(2002,4,1),B5<=DATE(2007,3,31)),((B3/5)*25)+((B3/5)*B7),
    IF(AND(B5>=DATE(2007,4,1),B5<=DATE(2009,4,31)),((B3/5)*24)+((B3/5)*B7),
    IF(B5>=DATE(2009,5,1),((B3/5)*21)+((B3/5)*B7),"ZERO")))))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-19-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2008 Mac
    Posts
    3

    Re: IF Formula not working...

    Thank you!!

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: IF Formula not working...

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ 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