+ Reply to Thread
Results 1 to 7 of 7

Semi Monthly autofill Period Starting Date based on Period Ending Date

  1. #1
    Registered User
    Join Date
    10-02-2012
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    35

    Semi Monthly autofill Period Starting Date based on Period Ending Date

    Hello,
    I'm trying to create a time card that is simple for novice users at my office to input their hours with as little manual input needed.
    The time card is semi monthly (twice a month) and the Period Starting Date is either the 1st or the 15th of the month.

    I already have a formula that returns the Period ending date of either the 15th or the end of the month built into a table that shows the past (2) semi monthly, the current semi monthly and the next (2) semi monthly dates. This is then used as a Data Validation list in cell Q10 to allow the person to select from the list and back fill a time card if they missed one, or fill one out for a future time card.
    I would like the Period Starting Date cell in Q9 to automatically fill with either the 1st or the 16th depending on what the Period Ending Date is. (I believe there are only four possible period ending dates that can either be 15th, 28th, 29th, 30th, or 31st of a month depending on the month and if it is a leap year.)

    I then have the time card automatically fill the 14, 15, or 16 days of the week based on the period starting and period ending dates.
    Please see the attached project for clarification. The highlighted period starting cell Q9 is what I'm trying to have Auto fill based on the period ending date in Q10.
    I already have (2) tables "Today" and Time Off" that I'm going to 'hide' from the worksheet, so If a table is needed to create the results and then referenced into Q9 that is ok. I will just hide the tables from view.

    I hope this makes sense what I'm trying to achieve. It's clear in my head, but whose to say my head is clear!
    Thanks!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    10-02-2012
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Semi Monthly autofill Period Starting Date based on Period Ending Date

    I found a formula that does half of what I'm looking for:
    something SIMILAR to this formula that reads cell Q10 and either rounds down to the 1st of the current month if it's the 15th (or) rounds up to the 1st of the next month if it's after the 15th.
    However I need it to round down to the 16th of the current month if it's after the 15th. (not round to the 1st of next month)
    =((DAY(Q10)>15)+MONTH(Q10)&"/1")+0
    or
    =IF(AND(DAY(Q10)>=1,DAY(Q10)<15),DATE(YEAR(Q10),MONTH(Q10),1),DATE(YEAR(Q10),MONTH(Q10)+1,1))

    That way I can place that formula in it's own cell and then have 'Period Starting' cell Q9 reference the rounded down date.

  3. #3
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Semi Monthly autofill Period Starting Date based on Period Ending Date

    I'm sure this can be simplified, but =IF(DAY(Q10)>15,DATE(YEAR(Q10),MONTH(Q10),15),DATE(YEAR(Q10),MONTH(Q10),1)) in cell Q9 works as far as I can tell.

  4. #4
    Registered User
    Join Date
    10-02-2012
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Semi Monthly autofill Period Starting Date based on Period Ending Date

    It appears that your modification works! I'm sure it can be simplified or even written a different way, but your method seems to work. Thanks BadlySpelledBuoy!

  5. #5
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Semi Monthly autofill Period Starting Date based on Period Ending Date

    Happy to help.

    Feel free to mark the thread as SOLVED if you're happy you have your answer.

    BSB

  6. #6
    Registered User
    Join Date
    10-02-2012
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Semi Monthly autofill Period Starting Date based on Period Ending Date

    I should have check it a little more thoroughly..It appears that when the period ending date is selected to be the end of the month, I need the period starting date to be the 16th....currently it shows as the 15th...
    so I changed 15 to 16 in your formula and it seems to work now for what I want.

    =IF(DAY(Q10)>15,DATE(YEAR(Q10),MONTH(Q10),16),DATE(YEAR(Q10),MONTH(Q10),1))
    Last edited by greatwent; 01-29-2014 at 07:22 PM. Reason: added corrected formula

  7. #7
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Semi Monthly autofill Period Starting Date based on Period Ending Date

    Apologies, that was me misreading your initial post slightly.

    Glad you have it sorted.

    BSB.

+ 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. Replies: 0
    Last Post: 07-25-2013, 10:03 AM
  2. [SOLVED] Complicated:Calculate time period based on no. of units sold + fluctuations within period
    By omaha.crab in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2012, 03:04 AM
  3. Counting data based on a date period eg. Month
    By jennyp in forum Excel General
    Replies: 3
    Last Post: 01-17-2008, 09:02 PM
  4. [SOLVED] Starting work period on a Saturday and ending on a friday
    By JLyons in forum Excel General
    Replies: 1
    Last Post: 02-18-2005, 10:06 AM
  5. [SOLVED] Starting work period on a Saturday and ending on a friday
    By JLyons in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-18-2005, 10:06 AM

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