+ Reply to Thread
Results 1 to 5 of 5

Need to count how many days in week period, if period starts mid week?

  1. #1
    Registered User
    Join Date
    06-24-2014
    Location
    South Wales
    MS-Off Ver
    2010
    Posts
    27

    Need to count how many days in week period, if period starts mid week?

    Sorry for the confusing title, not best sure how to title it! I have attached an example spread sheet to help you see what I mean. We invoice our providers 4 weekly, so 13 periods every financial year (Apr - Mar). Obviously that doesn't work out perfectly days wise per period, and the first and last period differs by a few days. What I need to work out is how many days per a week each period contains (the period dates are on sheet two, and are picked up on sheet 1 (4 weekly service user schedule) by entering the payment period in cell E4 on sheet 1). This sounds simple (i.e. =(B17-A17)+1), but for April, the week starts on Friday 1st (all the other periods start on a Monday) and all the period end dates fall on a Sunday. For period 13 the first 4 weeks will be 7 days, but the last week will be 5 days. So I need a formula that will look at the dates, and tell me how many days are in the first week (Monday to Sunday), then second, so on and so forth. So, ideally I would be looking at something like this as a result:

    Period 1:
    Week 1 (starts 1/4/16) - 3 days
    Week 2 (starts 4/4/16) - 7 days
    Week 3 (starts 11/4/16) - 7 days
    Week 4 (starts 18/4/16) - 7 days
    Week 5 (starts 25/4/16) - 6 days

    This then feeds back to sheet 1 (4 weekly service user spread sheet) to cells A65:B95. This will probably help you to understand why I need it in this format! I need this to update automatically, depending on the period number, which is entered in sheet 1, cell E4 (drop down).

    Any questions, please ask!

    Thanks in advance,
    Emma.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor loginjmor's Avatar
    Join Date
    01-31-2013
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    Excel 2013
    Posts
    1,073

    Re: Need to count how many days in week period, if period starts mid week?

    Hi -

    Are you sure you attached the correct file? The spreadsheet doesn't seem to correspond to your description.
    ____________________________________________
    If this has solved your problem, please edit the thread title to add the word [SOLVED] at the beginning. You can do this by
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

    If I have been particularly helpful, please "bump" my reputation by pressing the small star in the lower left corner of my post.

  3. #3
    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: Need to count how many days in week period, if period starts mid week?

    As loginjmor has said, I think your file's wrong - or it doesn't work without the links to another file which it appears to have.

    In the absence of the file, here's a suggestion:
    Create a separate sheet with a list of all the dates - i.e. 52 rows. Each row should have the period, week, start date, end date and number of days:
    Period | Week | Start Date | End Date | Days
    Your first start date is easy (1/4/2016). Though I'd recommend you put the year in another cell (let's say B1) and use this instead:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The end date of the first week is trickier, but you can get the date of the first Sunday in April by using this formula (with 2016 in cell B1):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The start and end date of weeks 2 to 51 are also easy - just add 1 to the previous end date, then 7 to the start date.

    The end date of week 52 (period 13 week 4) is again easy (31/3/2017), though again I'd recommend using a reference instead of a set year, like this (with 2017 in C1):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    You can then get the number of days for each period by subtracting the start date from the end date and adding 1 to make the number inclusive.

    I assume it's ok for the last 'week' (period 13 week 4) to be up to 14 days long (when 1 Apr falls on a Sunday)?

    Then, on the sheet you need the data on, use a Lookup to extract the number of days per period/week.

    Attached is a file showing this all working - I've used VLOOKUP on two example results sheets, but INDEX/MATCH would be more flexible depending on exactly what you want to achieve where. The cells into which you need to enter data (start year of financial year, or period) are shaded yellow.

    I hope that's of some help.
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  4. #4
    Registered User
    Join Date
    06-24-2014
    Location
    South Wales
    MS-Off Ver
    2010
    Posts
    27

    Re: Need to count how many days in week period, if period starts mid week?

    Thanks for your responses; I now realise I uploaded the wrong spread sheet!

    Having thought a bit more about what I needed to do, I came to the conclusion that what I was after was a bit contrived, and the easiest solution was to create separate spread sheets for periods 1 and 13 (which are not the standard 28 days long). This has worked, so happy now! But again, thanks for your inputs, much appreciated. Sometimes it takes an outsiders view to make the insider realise the (easiest) solution!

    Emma

  5. #5
    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: Need to count how many days in week period, if period starts mid week?

    Thanks for the feedback and 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] Calculate days left in a week period as they pass.
    By SenorPantalones in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-21-2014, 10:17 PM
  2. Replies: 6
    Last Post: 05-16-2014, 11:30 AM
  3. how to calculate days worked for an average over a five week period
    By Nicky_B in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-24-2014, 11:28 AM
  4. How to: identify repeat offenders within a 3 week period (week per week basis)
    By Heloc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2012, 12:43 AM
  5. Sum Over A Period of Time With Different Values For Different Days of the Week
    By ljustman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-08-2012, 12:58 PM
  6. [SOLVED] Count the number of projects completed within a 1 week period.
    By SWILLI99 in forum Excel General
    Replies: 6
    Last Post: 04-07-2012, 06:42 PM
  7. add data from other sheets within a period (week)
    By ionutz_nek in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-22-2009, 07:57 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