+ Reply to Thread
Results 1 to 6 of 6

VLOOKUP results from Datedif (employee length of svcs related)

  1. #1
    Registered User
    Join Date
    04-15-2016
    Location
    US
    MS-Off Ver
    2013
    Posts
    31

    VLOOKUP results from Datedif (employee length of svcs related)

    Hi,

    I am trying to determine the amount of PTO & bonus PTOs that will be earned in a particular year given the employee's length of service. Length of service will determine the amount of PTO earned, as well as any PTO bonuses for anniversaries (1 year, 3 years of service) in that year.

    The issue I am having is vlooking up the results from the Datedif formula against the criteria. How can I modify the VLOOKUP data to properly lookup from the correct bucket? Or, do I need to modify the lookup table?

    As such, how can I incorporate the bonuses for employees who have achieved anniversary dates?

    Thanks,
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: VLOOKUP results from Datedif (employee length of svcs related)

    1st, change your table to be like this, instead...
    E
    F
    1
    Years of Service
    PTO Days Earned Per Year
    2
    0
    10
    3
    1
    25
    4
    3
    30
    5
    50
    40


    Then use this formula...
    =VLOOKUP(ROUNDUP((D2-C2)/365.25,4),Sheet2!$E$2:$F$5,2,1)+IF(E2>3,10,5)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    04-15-2016
    Location
    US
    MS-Off Ver
    2013
    Posts
    31

    Re: VLOOKUP results from Datedif (employee length of svcs related)

    Quote Originally Posted by FDibbins View Post
    1st, change your table to be like this, instead...
    E
    F
    1
    Years of Service
    PTO Days Earned Per Year
    2
    0
    10
    3
    1
    25
    4
    3
    30
    5
    50
    40


    Then use this formula...
    =VLOOKUP(ROUNDUP((D2-C2)/365.25,4),Sheet2!$E$2:$F$5,2,1)+IF(E2>3,10,5)
    Hi,

    Thanks for your response. I want to use the 'Datedif' formula as the main indicator as to whether or not the employee completed the full year in relations to the respective anniversary date. Is there a way to revise the VLOOKUP with exact parameters?

    As a work around, would it be easier if I just assigned the different Years of Service with an dentifier for the lookup (Basically, assign the every single Year of Service with the PTO. i.e. Year 0 = 10 PTO, Year 1 = 25 PTO, Year 2 = 25 PTO). etc.

    The actual BONUS PTO tier is larger than the sample file. Employees gain the BONUS PTO when they reach the respective tiers. I apologize for the confusion.
    Last edited by Froogle; 06-26-2018 at 08:45 PM.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,913

    Re: VLOOKUP results from Datedif (employee length of svcs related)

    Change the value in B2:B5 to 0,1,3,6 and try:

    =VLOOKUP(E2,Sheet2!$B$2:$C$5,2,1)

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: VLOOKUP results from Datedif (employee length of svcs related)

    The part of the formula I used to calc years of service, calcs the exact same thing as DATEDIF does (and perhaps more accurately)...
    ROUNDUP((D2-C2)/365.25,4),
    I am rounding up to 4 decimal places so dates like 9/30/2017 to 9/30/2018 would be worked out properly
    (0.9993155)

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: VLOOKUP results from Datedif (employee length of svcs related)

    Thanks for the rep

+ 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] help with datedif formula nt returning the correct results
    By bugdout in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-23-2016, 11:31 AM
  2. adding Multiple DATEDIF Results - HELP!
    By DigitalFaerie in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-31-2014, 01:49 PM
  3. Formula don't Add related results
    By engmhelmy in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-22-2014, 04:34 AM
  4. Sumarizing results of DATEDIF function
    By ejla in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-23-2012, 04:19 PM
  5. DATEDIF and Custom format producing different results
    By Wirral Wizard in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-06-2010, 10:57 AM
  6. DATEDIF within VLOOKUP?
    By shrubman in forum Excel General
    Replies: 6
    Last Post: 09-01-2009, 11:44 AM
  7. Replies: 0
    Last Post: 07-12-2006, 02:05 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