+ Reply to Thread
Results 1 to 5 of 5

Calculate if date is < two other dates

  1. #1
    Registered User
    Join Date
    04-07-2016
    Location
    Salem, Oregon
    MS-Off Ver
    2010
    Posts
    2

    Calculate if date is < two other dates

    Hi there - I am new to this forum so please forgive me if this has been discussed although I haven't found a solution on here yet.

    I am working on an HR forecast in which I have a hire date and a term date for each employee. If the employee is currently active, their term date is input as 12/31/2016 (so they're active through the end of the year) but if they are termed at some point during the year, their term date would change to an actual date such as 5/13/2016.

    When I am trying to calculate their wages per month, I want to take their hourly rate*hours in the month, (for example January has 21 working days at 8 hours each = 168 hours). I have all the months in columns BH through BS and I want the monthly amount to populate only if the hire date is less than the current month, and the term date is greater than the current month. If the hire date isn't until 4/15/16, I don't want any info showing in the Jan, Feb, Mar columns. If the term date is 10/15/16 I don't want any info showing in Nov and Dec columns.

    I have a tried a couple things but I can't seem to get my formulas to work. Here is one that I have tried:

    D147 = Hire date
    BI145 = 2/1/2016
    AX147 = rate
    BH144 =hours in month
    E147 = term date
    BH145 = 1/1/2016

    To show the monthly rate for January: =IF($D147<BI$145,$AX147*BH$144,IF($E147>BH145,0,$AX147*BH$144))

    I've also tried some sumifs formulas and at this point I have just been looking at this way too long and I'm frustrated. Any help would be fantastic, thank you!
    Last edited by drehere; 04-08-2016 at 12:03 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: Calculate if date is < two other dates

    I would try a combination of MAX and MIN functions. Something like:

    =Hourly rate * MAX(0,NETWORKDAYS(MAX(Start date,start of month),MIN(Term Date,end of month), Holidays in month)) * hours per day
    Please add reputation by clicking on the * if I have helped.
    Please mark the thread SOLVED if your issue has been resolved.
    Thanks, Glenn.

  3. #3
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: Calculate if date is < two other dates

    I am assuming that if they start or end during the month they only get paid for the days they work.

    To clarify my formula with your references:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    10-19-2012
    Location
    Omaha, Nebraska USA
    MS-Off Ver
    Excel 2010
    Posts
    249

    Re: Calculate if date is < two other dates

    Hi Drehere,

    I have attached a workbook that I think is an example of what you are looking for.

    The basic formula I used to calculate each month's pay is given below, using January 2016 as an example:

    Please Login or Register  to view this content.
    Range B2 = Pay Rate
    Range C2 = Hire Date
    Range D2 = Termination Date

    The first "IF" in the line checks to see if the hire date is before the first day of the month, the next "IF" checks to see if the Termination Date is less than or equal to the last day of the month.

    The example in the attached workbook will provide more explanation.

    Hope it helps,

    Dan
    Attached Files Attached Files
    Last edited by djbomaha; 04-08-2016 at 12:52 AM.

  5. #5
    Registered User
    Join Date
    04-07-2016
    Location
    Salem, Oregon
    MS-Off Ver
    2010
    Posts
    2

    Re: Calculate if date is < two other dates

    djbomaha, this is exactly what I was looking for, thank you!!!! I tried it and it worked; you just saved my sanity. Gak, thank you for your response as well. You two are awesome, have a wonderful night!

+ 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] Trying to calculate- compares two dates, chooses later date, tells days to current date
    By Vicious00013 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-31-2016, 12:20 PM
  2. How do I calculate the number of dates between two date fields?
    By whsmith in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-22-2013, 03:02 PM
  3. [SOLVED] Calculate Date that is X number of biz dates in the future
    By tahoeast in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-19-2012, 06:45 PM
  4. Calculate next date in series of dates
    By led_blunt in forum Excel General
    Replies: 5
    Last Post: 09-24-2009, 02:23 PM
  5. [SOLVED] How do I calculate the midpoint date between two dates.
    By Allan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-12-2006, 10:55 AM
  6. Calculate Start Dates based on Need-By Date?
    By GB in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-21-2006, 02:15 PM
  7. How do I calculate dates backwards from a project end date
    By KathyC in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-07-2005, 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