+ Reply to Thread
Results 1 to 4 of 4

Calculating holiday entitlement accumulated to date based on today() and to meet condition

  1. #1
    Forum Contributor
    Join Date
    02-07-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    105

    Calculating holiday entitlement accumulated to date based on today() and to meet condition

    Dear All,

    I think I am overthinking this but can someone please have a fresh look at the attached file?


    i need to calculate holiday entitlement acquired to date in column V
    but conditions apply
    If AG<0 then
    1. if AF(start date) is greater than 06/04/2015 (cell D2) then need to count weeks between AF(start date) and today()
    2. if AF(start date) is earlier than 06/04/2015 (cell D2) then need to count weeks between D2 and today()

    but if AG is >0 then
    1. if AF(start date) is greater than 06/04/2015 (cell D2) then count the weeks between AF(start date) and AG(end date)
    2. if AF(start date) is earlier than 06/04/2015 (cell D2) then count the weeks between D2 and AG(end date)

    I have came up with months formula for my monthly holiday calculation but struggle with weekly.
    My monthly formula is:
    =((X8*5.6)/12)*IF(AND(AE8<$D$2,AF8=""),IF(DAY(NOW())>=DAY($D$2),0,-1)+(YEAR(NOW())-YEAR($D$2)) *12+MONTH(NOW())-MONTH($D$2),0)

    would greatly appreciate any help.
    Thank you!!!!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Calculating holiday entitlement accumulated to date based on today() and to meet condi

    Hi,

    I think this will work, using WEEKNUM to check the number of the week for Start Date, End Date and D2. I've also replaced your AG<0 with AG="" and I've used TODAY() not NOW() as it's just the date that matters, not the time.
    In English, if End Date is blank, this will subtract the week number of the Start Date from the week number of Today if the Start Date is after D2, otherwise it'll subtract the week number of D2 from Today's.
    If there is an End Date, it'll subtract the Start Date week number from the End Date week number if the Start Date is after D2, otherwise it'll subtract D2's week number from the End Date's.
    Running this on row 8 gives an answer of 20 for today, which looks to be correct to me, having manually counted weeks on a calendar.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Hope that works for you.

    Regards,
    Aardigspook

    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark Thread as Solved'.
    You don't need to give me rep if I helped, but thanks are appreciated.

  3. #3
    Forum Contributor
    Join Date
    02-07-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    105

    Re: Calculating holiday entitlement accumulated to date based on today() and to meet condi

    Thank you so much. Maybe i can solve.
    Your method does return current week 20th but doesn't return anything if AG>"" = when someone left

    i have changed the formula as follows so far
    =((Y8*AD8)/52)*IF(AG8="",IF(AF8>$D$2,WEEKNUM(TODAY())-WEEKNUM(AF8),WEEKNUM(TODAY())-WEEKNUM($D$2)),IF(AF8>$D$2,WEEKNUM(AG8)-WEEKNUM(AF8),WEEKNUM(AG8)-WEEKNUM($D$2)))

    sorry it DOES! returns negative value if after 01/01/2016 but i can take it from here.
    Need a big nice coffee now!
    Thank you.

  4. #4
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Calculating holiday entitlement accumulated to date based on today() and to meet condi

    Glad I could help and thanks for the rep.

    Edit: enjoy the coffee

    Regards,
    Aardigspook

    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark Thread as Solved'.
    You don't need to give me rep if I helped, but thanks are 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. Holiday entitlement checking
    By missbb in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-08-2015, 11:59 AM
  2. Replies: 3
    Last Post: 03-27-2015, 03:39 AM
  3. [SOLVED] Holiday Entitlement Formula
    By Calamity98 in forum Excel General
    Replies: 9
    Last Post: 02-17-2015, 06:06 PM
  4. Holiday Entitlement spreadsheet
    By Shelly8895 in forum Excel General
    Replies: 2
    Last Post: 03-10-2014, 12:29 PM
  5. Holiday Entitlement - extra days for service years
    By arg81 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-16-2014, 12:24 PM
  6. Holiday entitlement calculation
    By Green Gable in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-04-2013, 06:31 PM
  7. [SOLVED] Overdue vs Today Date based on Criteria Meet
    By pjlau in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-01-2012, 01:09 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