+ Reply to Thread
Results 1 to 2 of 2

Need a small macro function or formula

  1. #1
    Registered User
    Join Date
    11-19-2010
    Location
    Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    1

    Need a small macro function or formula

    EmployeeName Date WorkingFromTime WorkingToTime
    emp1 1/1/2010 0:01 1:50
    emp2 1/1/2010 1:00 5:00
    emp1 2/2/2010 5:00 13:50
    emp3 2/2/2010 1:00 5:00
    emp4 1/1/2010 5:00 6:00
    emp1 3/1/2010 9:00 12:00
    emp2 3/1/2010 10:00 13:00
    emp3 3/1/2010 14:00 16:00
    emp2 3/1/2010 16:00 18:00




    i need a VBA function which should accept the Date, Start Time , hours and headCount required as input parameter.

    For example if i pass


    example 1

    Date as 3/1/2010,
    Start Time 8:00
    hours as 2
    headCount as 2

    My output i need as

    emp1 10:00 12:00
    emp2 10:00 12:00

    because after 8.00 emp1 and emp2 have 14 to 16 hours free as common for 2 hours and head count as 2
    It means this 2 employees are free at 14 to 16 (railway timing)



    example 2

    Date as 3/1/2010,
    Start Time 8:00
    hours as 2
    headCount as 3

    My output i need as

    emp1 18:00 20:00
    emp2 18:00 20:00
    emp3 18:00 20:00

    because after 8.00 emp1,emp2 and emp3 have 18 to 20 hours free as common for 2 hours and headcount as 3
    It means this 2 employees are free at 14 to 16 (railway timing)



    I am doing Employee Scheduling. So i need free time for more than one employee at same time

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Need a small macro function or formula

    Hello mrk, welcome to the forum.

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    PLEASE PM WHEN YOU HAVE DONE THIS AND I WILL DELETE THIS POST

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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