+ Reply to Thread
Results 1 to 5 of 5

Work Schedule sign-in sheet formula

  1. #1
    Registered User
    Join Date
    10-30-2006
    Posts
    13

    Question Work Schedule sign-in sheet formula

    Hi all,
    I have not posted in a while but I would just like to say thank you to everyone who has helped me on this forum in the past. You guys are great!

    Now on to my question. I am trying to write a formula involving 2 separate spreadsheets.

    Spreadsheet A is a schedule with names going down column and a list of days going across a, b, c etc. If a person works on the corresponding day I have an X under the corresponding date column.

    I need to tie in a column on my sign-in sheet that will only display the names of the people with an x for that day into a name cell. Each sign in sheet I make is for a different day of the week. So I would have a sign in sheet for the 1st of the month with a listing of everyone who has an x under the 1st date column from spreadsheet A.

    I was thinking something along the lines of
    ='[spreadsheet a.xls] “(name cell) if (date column)=”x” elseif (then go on to the next person and check if they have an x on that day)
    I am not sure if I am explaining this correctly. Is this even possible?

    Any help would be great. Thank you in advance.

  2. #2
    Forum Contributor
    Join Date
    11-29-2003
    Posts
    1,203
    I think this is possible.

    To start with, let's take the simplest case. Instead of two workbooks, you have one and instead of a sheet for every day of the week, you have only one sheet. How are you going to create a list of only those people with an "x" next to their names?

    You have 2 options:
    1. use VBA
    2. use formulas

    You put the question in the "Programming" section, so I'm thinking you want VBA, and this can pretty easily be done using VBA, I think. (Famous last words?)

    But, the example you posted is a formula. I think it can also be done with array formulas and Indirect cell references. Strating with the simplest case, the following array formulas will return only row numbers (which can be combined with the INDEX function to bring back cell contents) for those rows that have an x in column A. The first cell would have this formula:
    Please Login or Register  to view this content.
    each subsequent row will have a formula like this:
    Please Login or Register  to view this content.
    You can avoid using the Ctrl+Shift+Enter routine if you use the SUMPRODUCT function:
    Please Login or Register  to view this content.
    Anyway ... let us know if you want to use formulas or VBA.

  3. #3
    Registered User
    Join Date
    10-30-2006
    Posts
    13

    Smile

    Lets try VB

  4. #4
    Registered User
    Join Date
    08-10-2006
    Posts
    58
    OK, I found the easiest way to do it was a small combo of VB and formulas. I will try to attach an example spreadsheet that you could probably easily modify for your use. There is a Data sheet which contains all your employees in column A with dates in row 1 and X's on the days they are working. Cell A1 has the date for the sign in sheet (if you print a new one every day, you'd probably want to replace that with the formula TODAY() so that you don't need to constantly update it). On the Sign-In sheet, Column A has all the employees again. Cell B1 is linked to the date of interest for the spreadsheet, and beneath it in column B, each cell has the formula "=HLOOKUP($B$1,Data!$B$1:$K$9,ROW())". The Data array would need to be changed to fit your actual sheet.

    As far as the VBA code goes... I know there's a way, but I don't know how to make the hiding automatically happen, so I put in a command button that triggers it. This is the code you need:

    Please Login or Register  to view this content.
    This will hide all the rows that do not contain the "X". It will still show the X, so if you don't want that, throw in
    Please Login or Register  to view this content.
    before the ScreenUpdating = True line. Hope this helps you enough, but let me know if there's something I missed.
    Attached Files Attached Files
    Last edited by redstang423; 03-30-2007 at 11:54 AM. Reason: Add Attachment

  5. #5
    Registered User
    Join Date
    10-30-2006
    Posts
    13
    Simply amazing, Thank you so much. Works Great!

+ 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