+ Reply to Thread
Results 1 to 5 of 5

Create smaller table with dropout date list

  1. #1
    Registered User
    Join Date
    10-27-2018
    Location
    Romania
    MS-Off Ver
    excel 2010
    Posts
    19

    Create smaller table with dropout date list

    Hi, i can't figure out how to do this. I have a monthly schedule table for a company where people work in 3 shifts. The day off in shown the table as o and the working day is shown either by 1,2 or 3 showing not only that the employee is working but also in what shift he is working.
    The problem is that i want to create a smaller table underneath, based on the schedule table that has a dropout list consisting of the day months which will show the employees at work for the day selected in the dropout list. And also i want the dropout list to know the present day. Today is 27 Octomber and i want the dropout list to show 27 and the people that are working today, when i open the file.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Create smaller table with dropout date list

    Hi and welcome to the forum.

    As for second part - automatic setting of current day on workbook opening, you shall save your file in macro-enabled format (xlsm. xlsb or xls) and add simple code to Thisworkbook module:
    Please Login or Register  to view this content.
    I have not included this, as the second part would return error, because there is no data for 27th in the sample file

    The first part I'd do with an array formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    10-27-2018
    Location
    Romania
    MS-Off Ver
    excel 2010
    Posts
    19

    Re: Create smaller table with dropout date list

    Thank you!

  4. #4
    Registered User
    Join Date
    10-27-2018
    Location
    Romania
    MS-Off Ver
    excel 2010
    Posts
    19

    Re: Create smaller table with dropout date list

    Can someone explain how this array formula works because i have a hard time understanding it?

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Create smaller table with dropout date list

    Analysis of excel formulas shall go from innermost part outside. So let's try:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    this takes four vertical cells from rows 6:9 from column laying A12 rows right from column A so with A12=1 it takes data from column B (remember - rows 6:9, so from range B6:B9: o;2;o;2 ), if A12 = 3 from column D (so from range D6:D9), etc.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    for each of 4 cells in such range formula compares it with o. If it is not o (for instance B7) then it takes its row number (7) and deducts 5, if it is o - then it thakes just empty text ("") so for A12=1 the bold part will give:
    (empty text)
    2
    (empty text)
    4
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    this (having in mind that the formula is in cell A14) returns first smallest value of such 4 values. Of course it is 2. the formula is copied down, so in A15 it reads:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    so it finds second smallest value: 4
    but in A16
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    there is no third smallest value - so it returns an error.
    So if in A14:A17 we would have only this bold part we would have there
    2
    4
    #VAL!
    #VAL!
    now:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    we are taking from range A6:A9 the value from the cell from row determined on previpis step, so values from cells:
    A7 value (Smith)
    A9 value (Broke)
    #VAL! (and no values for next cells - still errors)
    #VAL!
    and to deal with these errors there is outermost instruction IFERROR, which changes each error into empty text, leaving non-error values untouched
    A7 value (Smith)
    A9 value (Broke)
    (empty text)
    (empty text)

    Hope it's clear now.
    Last edited by Kaper; 11-02-2018 at 04:25 AM. Reason: added colour as bold only was not well visible inside formulas

+ 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. Replies: 9
    Last Post: 01-16-2018, 06:15 PM
  2. Calculating dropout help needed!!!
    By cicapuki in forum Excel General
    Replies: 1
    Last Post: 12-28-2015, 03:59 PM
  3. [SOLVED] code to update certain cells in a master table from a smaller table on another workeheet?
    By Rerock in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2015, 04:52 PM
  4. Replies: 2
    Last Post: 01-20-2014, 07:05 PM
  5. Macro - Create smaller word tables from master excel table
    By VBA_n00b in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-22-2011, 10:12 PM
  6. Replies: 15
    Last Post: 06-26-2011, 09:10 PM
  7. want to findout dropout
    By younker1983 in forum Excel General
    Replies: 1
    Last Post: 08-14-2006, 03:40 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