+ Reply to Thread
Results 1 to 7 of 7

Excel vba code for working out hours in a roster

  1. #1
    Registered User
    Join Date
    01-02-2019
    Location
    Christchurch, New Zealand
    MS-Off Ver
    365
    Posts
    3

    Question Excel vba code for working out hours in a roster

    As the title says, I wish to be able to work out how many hours, automatically, people have been rostered on for...

    Capture.PNG

    In this example I have a group of employees that work certain hours, but not the same hours each week and I need to be able to work out if anyone is either too low (contractual) or too many...

    For example :
    Monday
    Alfred (D5) works for 12 (F4) hours
    Edina (D8) works for 6 (F7) hours
    Leonie (D11) 6 (F10) hours

    Tuesday
    Leonie (G5) a 12 (I4) hours
    Spencer (G8) a 6 (I7)


    The hours of each shift is the greyed numbers in F, I etc and Id like to be able show the total hours for each person...

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Excel vba code for working out hours in a roster

    The hours of each shift is the greyed numbers in F, I etc and Id like to be able show the total hours for each person...
    Formula in F4

    =TIME(LEFT(RIGHT(D4,4),2),RIGHT(D4,2),0)-TIME(LEFT(RIGHT(D4,9),2),LEFT(RIGHT(D4,7),2),0)

    If you upload a workbook with before/after, it will help to write a vba code.

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    01-02-2019
    Location
    Christchurch, New Zealand
    MS-Off Ver
    365
    Posts
    3

    Re: Excel vba code for working out hours in a roster

    Thank you Jindon, but that wasn't what I needed, I need to be able to show the TOTAL hours per week for each individual person

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Excel vba code for working out hours in a roster

    Can not write a code from a PICTURE.

  5. #5
    Registered User
    Join Date
    01-02-2019
    Location
    Christchurch, New Zealand
    MS-Off Ver
    365
    Posts
    3

    Question Re: Excel vba code for working out hours in a roster

    As requested, Sheet2 is original (redacted)
    Sheet2 (2) is what I'd like to be able to get... but doing it automatically

    Inparticular column X to go with the names in W
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Excel vba code for working out hours in a roster

    You need to check your calculation...
    Please Login or Register  to view this content.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Excel vba code for working out hours in a roster

    You are welcome and thanks for the rep.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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. Roster Days to Hours per Week?
    By Gazsim in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-17-2018, 10:32 AM
  2. Automated Roster Hours/Conflict Highlighting.
    By the133448 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-06-2018, 07:35 AM
  3. Roster calculation of hours formulas
    By MIGHTYJ4CK in forum Excel General
    Replies: 3
    Last Post: 09-21-2015, 12:06 AM
  4. [SOLVED] Kitchen roster: working hours - breaks
    By qkta in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-24-2015, 09:53 AM
  5. creating a shift roster, need to add hours
    By MissLink in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-25-2013, 09:42 AM
  6. Replies: 2
    Last Post: 06-14-2013, 10:45 AM
  7. Replies: 3
    Last Post: 11-21-2009, 01:44 PM

Tags for this Thread

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