+ Reply to Thread
Results 1 to 19 of 19

Using SUMPRODUCT to count entries between the times of 12am-1am only

  1. #1
    Registered User
    Join Date
    03-17-2024
    Location
    Victorville
    MS-Off Ver
    MS Office 2021
    Posts
    8

    Using SUMPRODUCT to count entries between the times of 12am-1am only

    Hello Fourm,

    Hope to find a simple solution to the following problem im facing.

    I currently have the formula below for cell b8

    =SUMPRODUCT((B14:B184<=INDEX!G5)*(B14:B184>=INDEX!F5))

    its the only one cant figure out.

    attached are screenshots of how my index tab and entry tab looks like.

    INDEX TAB.png

    01 TAB.png

    Thanks,

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,883

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. The sample layout accurately matches that of your real data. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    03-17-2024
    Location
    Victorville
    MS-Off Ver
    MS Office 2021
    Posts
    8

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

    P UNITS TRACKER.xlsm

    spreadsheet sample attached

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

    I don't see any issues with your formula. Perhaps the array is not locked. Please try the below one and if the problem still persists, kindly provide your sample workbook.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Registered User
    Join Date
    03-17-2024
    Location
    Victorville
    MS-Off Ver
    MS Office 2021
    Posts
    8

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

    thank you!

    added the formula but still does not count it.

    P UNITS TRACKER-edited.xlsm

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,883

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

    It's because G5 and F5 have an underlying date (01/01/1901), so you need to change them to times ONLY. In other words, delete the date part.
    Attached Files Attached Files

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,883

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

    Here's the workbook with the fix applied.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    03-17-2024
    Location
    Victorville
    MS-Off Ver
    MS Office 2021
    Posts
    8

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

    I tried that but cell B8 still stays gray does not change

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,883

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

    Look at the attachment to post #7. Did you also remove the SPACE between the date and the time?

    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    A
    B
    8
    4th HOUR - ( 12AM - 1AM )
    139
    Sheet: 01

  10. #10
    Registered User
    Join Date
    03-17-2024
    Location
    Victorville
    MS-Off Ver
    MS Office 2021
    Posts
    8

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

    I see a number now, but that is incorrect. the time stamps from b14 to b45 there are only 2 entries within the range of 12am-1am. how can I fix it to return the correct count.

  11. #11
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

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


    there is only one 12:20:21 AM
    Last edited by shukla.ankur281190; 03-20-2024 at 03:06 AM.

  12. #12
    Registered User
    Join Date
    03-17-2024
    Location
    Victorville
    MS-Off Ver
    MS Office 2021
    Posts
    8

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

    sorry yes only one. my apologies

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,883

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

    I think it's the dates in the time values that are messing things up. I can see only ONE value that should count, actually, not two.

    This will work if you get rid of the dates in your entries:

    =SUMPRODUCT((B14:B184<=INDEX!G5)*(B14:B184>=INDEX!F5)*(B14:B184<>""))

  14. #14
    Registered User
    Join Date
    03-17-2024
    Location
    Victorville
    MS-Off Ver
    MS Office 2021
    Posts
    8

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

    wowwwwww that worked!!!!!!!

    now i would not be able to sleep.

    thank you so much for the help shukla

  15. #15
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

    Because in formula, Excel treats blank value as 0. therefore a criteria statement like: (B4:B184<>"") should be add in SUMPRODUCT (as #11 did)
    Quang PT

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,883

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

    You would be better off cleadning the dates out of the time data and then using this:

    =SUMPRODUCT((B14:B184<=INDEX!G5)*(B14:B184>=INDEX!F5)*(B14:B184<>""))

    Get the input right in the first place and the rest will look after itself. I've removed dates from the entries in yellow.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    03-17-2024
    Location
    Victorville
    MS-Off Ver
    MS Office 2021
    Posts
    8

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

    Thank you aligw and shukla for your input and great help!!!

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,883

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

    Please see my advice in post #16. The solution you've been given is a workaround - you need to cleanse your data entries.

  19. #19
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,883

    Re: Using SUMPRODUCT to count entries between the times of 12am-1am only

    Please mark this thread as SOLVED, as advised in post #16.

+ 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] Count overlapping times SUMPRODUCT?
    By excelstar1978 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-29-2019, 08:51 AM
  2. [SOLVED] Timesheet total for hours worked between specific times of day e.g. 10pm to 12am
    By thisfatcat in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-05-2017, 01:13 AM
  3. Count the number of times a quantity of entries occur within a range
    By sameg in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-27-2015, 10:35 AM
  4. [SOLVED] Count unique entries that appear the most times
    By Tony Valko in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 08-04-2015, 08:23 PM
  5. [SOLVED] Using SUMPRODUCT or COUNTIF to count number of times a value occurs
    By Moco123 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-04-2012, 09:50 AM
  6. sumproduct to count number of times between dates
    By steeley7 in forum Excel General
    Replies: 5
    Last Post: 04-08-2010, 05:18 PM
  7. Sumproduct-count entries
    By yhlin in forum Excel General
    Replies: 3
    Last Post: 04-10-2007, 01:59 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