+ Reply to Thread
Results 1 to 16 of 16

Date workings

  1. #1
    Forum Contributor
    Join Date
    02-14-2012
    Location
    Warrington
    MS-Off Ver
    Excel 365
    Posts
    377

    Date workings

    I've managed to get the info I need for the "timesheet" worksheet, but the workings behind it on the "Workings" worksheet feel a very inefficient. Is anyone able to streamline it???

    Basically want to work out for each week in a given month:

    -W/C date (Monday)
    -First working day date (W/Ds being Mon-Fri)
    -Last working day date
    -Number of working days

    This data is currently on the workings sheet in the orange/yellow table on the right but to get there I've had to use a sub working table in grey/black that feels very long winded


    http://www.filedropper.com/dateworkings
    (Can you no longer upload files directly to this forum?)

    Thanks

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: Date workings

    Try this out (not extensively tested...).

    BtW, you can upload files here still. But. Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Contributor
    Join Date
    02-14-2012
    Location
    Warrington
    MS-Off Ver
    Excel 365
    Posts
    377

    Re: Date workings

    Hi

    Thanks for having a go Glenn.

    Column C needs to be "First working day of the week date" and column D needs to be "Last working day of the week date". So in the Mar 18 example, yours returns

    Week W/C Calendar Start Calendar End Working Days
    1 26/02/2018 01/03/2018 04/03/2018 2
    2 05/03/2018 05/03/2018 11/03/2018 5
    3 12/03/2018 12/03/2018 18/03/2018 5
    4 19/03/2018 19/03/2018 25/03/2018 5
    5 26/03/2018 26/03/2018 01/04/2018 4

    This should show

    Week W/C 1st W.D Last W.D Working Days
    1 26/02/2018 01/03/2018 02/03/2018 2
    2 05/03/2018 05/03/2018 09/03/2018 5
    3 12/03/2018 12/03/2018 16/03/2018 5
    4 19/03/2018 19/03/2018 23/03/2018 5
    5 26/03/2018 26/03/2018 29/03/2018 4 (Bank holiday on the 30th)

    Are you able to help tweak it? Thanks

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Date workings

    The tweak is easy, and to learn excel you should really try and work that out yourself.
    currently in d5 =IFERROR(B5+6,"") so the end of the week is the start of the week (b5) plus 6 days, you want it to stop on the friday and so plus 4 days.
    =IFERROR(B5+4,"")

  5. #5
    Forum Contributor
    Join Date
    02-14-2012
    Location
    Warrington
    MS-Off Ver
    Excel 365
    Posts
    377

    Re: Date workings

    Quote Originally Posted by davsth View Post
    The tweak is easy, and to learn excel you should really try and work that out yourself.
    currently in d5 =IFERROR(B5+6,"") so the end of the week is the start of the week (b5) plus 6 days, you want it to stop on the friday and so plus 4 days.
    =IFERROR(B5+4,"")
    With a response like that I'd rather you had not bothered to be honest. I do know Excel and before I posted I did come up with a solution myself. The request was to HELP streamline my method which felt rather long winded. Glenn has kindly done this but it needs a small tweak that I've had a go at doing but can't come up with a neat quick solution so was seeing if I could get further guidance. You've had a go so thanks for that but it's not actually solving the issue I asked about as you've completely ignored the bank holiday issue and your response also has a sly dig bundled in with it that is unnecessary.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: Date workings

    It's not quite that simple, 'cos of the bank holiday. Use this:

    =IFERROR(WORKDAY(C5,E5-1,T_BH[Bank holidays]),"")

    Improved (correct!!) formula for column E

    =IFERROR(NETWORKDAYS(C5,B5+4,T_BH[Bank holidays]),"")
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    02-14-2012
    Location
    Warrington
    MS-Off Ver
    Excel 365
    Posts
    377

    Re: Date workings

    Quote Originally Posted by Glenn Kennedy View Post
    It's not quite that simple, 'cos of the bank holiday. Use this:

    =IFERROR(WORKDAY(C5,E5-1,T_BH[Bank holidays]),"")

    Improved (correct!!) formula for column E

    =IFERROR(NETWORKDAYS(C5,B5+4,T_BH[Bank holidays]),"")
    Thankyou. Not looking very good for Apr18 where there was a bank holiday on the first Monday. Column C needs a networkdays in it to I feel

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: Date workings

    Apologies for the delay. I've been out monkeying around. Try this. Tested more than the first ones!!
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    02-14-2012
    Location
    Warrington
    MS-Off Ver
    Excel 365
    Posts
    377

    Re: Date workings

    The first week in Apr18 still looks a bit astray

    Week Monday First WD of weekLast WD of weekWorking Days
    1 26/03/2018 02/04/2018 29/03/2018 -2
    2 02/04/2018 02/04/2018 06/04/2018 5
    3 09/04/2018 09/04/2018 13/04/2018 5
    4 16/04/2018 16/04/2018 20/04/2018 5
    5 23/04/2018 23/04/2018 27/04/2018 5
    6 30/04/2018 30/04/2018 30/04/2018 1

    First working day and last working day should essentially be blank as the 1st Apr is a sunday. Any ideas? Thankyou for your help!

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: Date workings

    Any ideas, he asks... Yes. Time to take me out into a field and shoot me.

    Another go!!
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    02-14-2012
    Location
    Warrington
    MS-Off Ver
    Excel 365
    Posts
    377

    Re: Date workings

    Haha sorry this is turning into one of those requests that I bet you never offered to help with!!

    Apr18 looks good, it now ignores week 1 being the 1st Apr (sunday), I was hoping it would still show W/C the 26th March and then no working days or dates but that's not a biggie. Problem is is Dec18 is the opposite, week 1 shows the W/C 26th nov but with first and last working days the same as shown on week 2. The 2 non working days (Sat / Sun) seem to be the issue.

  12. #12
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Date workings

    I have not checked everything but perhaps b5 is =IF(WEEKDAY(B1,2)>=6,7,0)+$B$1-CHOOSE(WEEKDAY($B$1,2),0,1,2,3,4,5,6)

  13. #13
    Forum Contributor
    Join Date
    02-14-2012
    Location
    Warrington
    MS-Off Ver
    Excel 365
    Posts
    377

    Re: Date workings

    Quote Originally Posted by davsth View Post
    I have not checked everything but perhaps b5 is =IF(WEEKDAY(B1,2)>=6,7,0)+$B$1-CHOOSE(WEEKDAY($B$1,2),0,1,2,3,4,5,6)
    Ye I suppose that's one way of doing it, was trying to keep the W/C date even if the month starts with a sat/sun but that works so thankyou for all your help!

  14. #14
    Forum Contributor
    Join Date
    02-14-2012
    Location
    Warrington
    MS-Off Ver
    Excel 365
    Posts
    377

    Re: Date workings

    Sorry to revive this old thread but I've realised after testing this for a while that cell D5 is not working when the first working day of the month falls on a Thursday or Friday. I've done a work around but it feels pretty long winded with lots ifs so was wondering if anyone could come up with anything more efficient. Workbook attached with the formula that dosent work.

    Useful months to check the formula in D5 works are:

    Oct 18 Mon 1st WD
    Jan 19 Tue 1st WD
    Aug 18 Wed 1st WD
    Nov 18 Thu 1st WD
    Mar 19 Fri 1st WD
    Attached Files Attached Files

  15. #15
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Date workings

    perhaps
    c5 ==IFERROR(IF(MONTH(B1)=MONTH(B5),WORKDAY(MAX($B$1-1,B5-1),1,T_BH[Bank holidays]),$B$1),"")
    d5 =IFERROR(WORKDAY(MIN(EOMONTH($B$1,0)+1,B5+5),-1,T_BH[Bank holidays]),"")

  16. #16
    Forum Contributor
    Join Date
    02-14-2012
    Location
    Warrington
    MS-Off Ver
    Excel 365
    Posts
    377

    Re: Date workings

    Quote Originally Posted by davsth View Post
    perhaps
    c5 ==IFERROR(IF(MONTH(B1)=MONTH(B5),WORKDAY(MAX($B$1-1,B5-1),1,T_BH[Bank holidays]),$B$1),"")
    d5 =IFERROR(WORKDAY(MIN(EOMONTH($B$1,0)+1,B5+5),-1,T_BH[Bank holidays]),"")
    Thanks, D5 works great from what I've just tested. I'll leave c5 as it was as it seemed to be working fine and was a shorter formula, unless you spotted it wasn't working??

+ 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. Tidy Exported File for Use in Formulas and Workings
    By TommoLyndoch in forum Excel General
    Replies: 1
    Last Post: 12-02-2016, 04:42 AM
  2. How to create a MACRO run button and hide all the VBA Codes workings in it
    By PRADEEPB270 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-09-2013, 11:51 PM
  3. Replies: 3
    Last Post: 09-06-2013, 06:52 AM
  4. Replies: 1
    Last Post: 10-02-2012, 02:42 PM
  5. [SOLVED] If contains - nested ifs - shift workings
    By nd2828 in forum Excel General
    Replies: 2
    Last Post: 05-09-2012, 11:12 AM
  6. Eliminating all the messy workings
    By ray? in forum Excel General
    Replies: 5
    Last Post: 08-25-2005, 12:05 PM
  7. How can I do finacial ratios with workings using excel?
    By kudzie in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-18-2005, 12: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