+ Reply to Thread
Results 1 to 5 of 5

Formular to calculate how many instances of cells with time within 7:01 AM to 7:30 AM

  1. #1
    Registered User
    Join Date
    12-20-2008
    Location
    Denmark
    Posts
    12

    Formular to calculate how many instances of cells with time within 7:01 AM to 7:30 AM

    I have a work schedule for my employees, where I want to have an overview of how many at work at 7:30, at 8:00, at 8:30 etc.
    Years ago I got help in here to calculate how many instances of "7:30" is found within a given cell range.
    But now I have to have varied meeting times, so if someone has a 7:45 meeting time, it won't be noticed by the system. Can I have it check for all times between 7:01 to 7:30 AM? Then I know how many are at work at 7:30.

    I use this formular now:
    =COUNTIF(G$4:G$15, "7:30")+(G18)

    You can make a copy of this Google Sheets (which I work in, not Excel but hope the formular is the same) and try it yourself, if you know a solution:
    https://docs.google.com/spreadsheets...it?usp=sharing

    Beneath the work schedule, is the cells where I would like to see how many are at work at 7:30, and further down is shown how many is left at work at 15:30 e.g.

    thank you in advance, if possible.

    Greetings, Jamie from Denmark

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Formular to calculate how many instances of cells with time within 7:01 AM to 7:30 AM

    Moved to GS sub-forum.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: Formular to calculate how many instances of cells with time within 7:01 AM to 7:30 AM

    Clear out the cells C17:L22.

    Put this formula into C17:
    Please Login or Register  to view this content.
    Then drag it across to L17

    Clear out the cells C24:L30

    Put this formula into cell C24:
    Please Login or Register  to view this content.
    Drag it across to L24
    Last edited by janmorris; 03-15-2024 at 10:05 AM.
    As a gesture off appreciation, you can click * Add Reputation at the foot of any of the posts of members who helped you reach a solution.

    And finally, was your problem solved? if so, please click Thread Tools above the first post of your enquiry, then select [Solved]

  4. #4
    Registered User
    Join Date
    12-20-2008
    Location
    Denmark
    Posts
    12

    Re: Formular to calculate how many instances of cells with time within 7:01 AM to 7:30 AM

    Wouw... That is so sick. It is perfect! When I look at the formular, I don't even understand what it does.

    BYROW is a function that just avoids you having to place a formular in each cell in the column, so it makes it easier for edits, right?

    LAMBDA, what does that do?

    starts and ends - I dont understand what this refers to, probably the following part (which I don't understand either). How does it know, what range I want - in the BYROW cells, there is text and numbers, so it can't get "7:30" from that, I suppose.

    The >= division of the formular I also dont understand.

    REGEXEXTRACT Ah, this one extracts part of a text, but the cells doesnt say start or end anywhere

    The slash b slash d 1,2 etc, I don't understand that either.

    You don't have to, but out of curiousity and if I should make or edit this formular myself sometime, if you have the time can you then explan the formular from the >= and REGEXEXTRACT and onwards?

    Well, thank you so much for saving me time! Not back to fixing the whole in the work schedule, after a newly recruited employee left for another job, three days before the two teambuilding days I planned for the new team on monday! Mine was temporary and she got a lasting job, so understandable.

  5. #5
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: Formular to calculate how many instances of cells with time within 7:01 AM to 7:30 AM

    BYROW tells the LAMBDA to process each row (of the given range) in turn.

    LAMBDA gives a name to the range that was given.

    The name is then used in the main formula.

    The effect is that the range is processed by the main formula, on a row-by-row basis.

    The regex in both formulas can be shortened, by removing the preceding and trailing \b like this:
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    This extracts 1 or 2 digits, followed by colon, followed by 2 digits.

    Note that the *1 is required to turn the extracted time, which will be a text string, into a numeric value, which can then be used for the comparison against each cell.

+ 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. [SOLVED] Formular to calculate percentage
    By issa.o in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-08-2022, 12:11 PM
  2. [SOLVED] Formular to Calculate if a name has been used
    By Por2gal in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-11-2019, 03:24 PM
  3. Replies: 12
    Last Post: 02-12-2017, 06:09 PM
  4. Need to Calculate Total Hours from 2 date cells and 2 time cells in military time.
    By psunursingguy21 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 06-07-2015, 06:46 PM
  5. [SOLVED] Calculate values in col B based on value in col B but only calculate final 5 instances
    By arnoldd99 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-04-2013, 11:53 AM
  6. Formular to calculate variation percentage
    By cashflaw in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-26-2013, 02:28 AM
  7. [SOLVED] Formular to calculate difference between cells if cells in a range are the same
    By CharlieZangel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2012, 04:41 PM

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