+ Reply to Thread
Results 1 to 5 of 5

Counting People Who Work Each Hour EXPLAINED

  1. #1
    Registered User
    Join Date
    08-25-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    6

    Counting People Who Work Each Hour EXPLAINED

    Hey all,

    I've just started back into using excel and I am currently designing a timetable for a business. In this timetable I would like to be able to count the staff "coverage" of the shop and came across the forum post (http://www.excelforum.com/excel-form...each-hour.html) which provided a file and a working code to do this with.

    HOWEVER!!
    I am unsure on the purpose of some of the formula and was wondering if anyone would be kind enough to explain it to me so I can keep using excel with an understanding, rather than just grabbing other peoples work!
    Here is the formula used and the original file respectively:

    Please Login or Register  to view this content.
    Copy of Template Drop Down with Coverage Chart-1.xls

    Hope someone can help!

    Thanks

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Counting People Who Work Each Hour EXPLAINED

    Hi Browun and welcome to the forum.

    What was this guy smoking when he wrote that formula???

    Why would a person ever use Mod(.. , 1)??

    So in this problem you need to add 1 if a person is working between two consecutive hours that are in Column B.

    The first part of the formula in D29 is easy enough when it shows..
    Please Login or Register  to view this content.
    WAIT, WAIT... this returns True or False for all the D5 to D18 cells. You can't add or multiply True or false, they need to be turned into NUMBERS.

    This is a common problem when using SumProduct and us normal Guru's change this True/False stuff to numbers by taking the negative or the negative of it. We use:
    Please Login or Register  to view this content.
    It looks like the formula you have used the MOD(.., 1) function to turn those things into numbers....

    Try this formula in D29 instead of the one you have above and pull it down. Then test it by putting some start and end numbers in column D and E.
    Please Login or Register  to view this content.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,695

    Re: Counting People Who Work Each Hour EXPLAINED

    No need for the double-minuses, Marvin - the multiplication operator (equivalent to AND for arrays) will coerce the True/False values to 1's or zeros.

    I think the MOD(...,1) might be there to ensure that any dates among the times (and, indeed, any times over 24 hours which will count as 1 day plus) get omitted

    Pete

  4. #4
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Counting People Who Work Each Hour EXPLAINED

    Additionally, for the OP, it's worth investigating the "Evaluate Formula" tool in Excel. You can find it in Formulas --> Evaluate Formula (in the Formula Auditing section)

    Just select the cell with the formula, click on Evaluate Formula, and click on Evaluate button and see what happens.

  5. #5
    Registered User
    Join Date
    08-25-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    6

    Re: Counting People Who Work Each Hour EXPLAINED

    Thank you all for the responses, they were all useful and I will definitely start using the "Evaluate Formula" tool, it's already helped me more than once!

    I have sadly though hit another snag on my excel sheet and so if any of you would like to give your 2 cents that would be appreciated!

    (http://www.excelforum.com/excel-form...ml#post4184183)

    Thanks Again

+ 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. Counting The Number Of Extra People Working Each Hour
    By stagnut in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-19-2014, 07:52 AM
  2. Counting People Working Each Hour
    By smadan002 in forum Excel General
    Replies: 2
    Last Post: 07-16-2014, 03:36 AM
  3. Counting People Working Each Hour
    By snapper in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-24-2014, 06:55 PM
  4. [SOLVED] Counting Total People Coming In Over 1 Hour Block
    By grunge in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-26-2013, 03:35 AM
  5. Counting the Number of people on a course
    By markgriggs in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-18-2012, 06:27 AM
  6. Counting Formulas -- Re-explained
    By MAB in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-12-2006, 05:25 PM
  7. [SOLVED] Counting people
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-25-2005, 09:05 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