+ Reply to Thread
Results 1 to 5 of 5

Help: I need a formula that counts how many cells in a range match another range

  1. #1
    Registered User
    Join Date
    06-02-2023
    Location
    Huddersfield
    MS-Off Ver
    2019
    Posts
    3

    Help: I need a formula that counts how many cells in a range match another range

    It sound simple enough, but no matter what I do it will not count how many cells in my range C2:C48, match those in my criteria E2:K33.

    The cells in column C are a result of a formula (which I actually got from ChatGPT), which lists 15 minute intervals between cells A1 and B1. So i don't know if it's the fact they're a formula which is throwing off the count functions.
    Ideally, I would like this tool for anyone to be able to put in a start and end time, and the formulas will count how many of those 15 minute intervals match those of the criteria.

    I hope this makes sense, I've tried to make it as simple as possible.

    Book1.xlsx

  2. #2
    Forum Contributor NewYears1978's Avatar
    Join Date
    03-15-2010
    Location
    Forney, TX
    MS-Off Ver
    Excel 2016
    Posts
    962

    Re: Help: I need a formula that counts how many cells in a range match another range

    Simple Countif
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    06-02-2023
    Location
    Huddersfield
    MS-Off Ver
    2019
    Posts
    3
    Quote Originally Posted by NewYears1978 View Post
    Simple Countif
    Thanks! But it doesn't quite work, it omits some of the results, for some reason... For example c41 appears in E31, yet that isn't being counted?

  4. #4
    Registered User
    Join Date
    06-02-2023
    Location
    Huddersfield
    MS-Off Ver
    2019
    Posts
    3

    Re: Help: I need a formula that counts how many cells in a range match another range

    I think I've worked it out, if I use a value formula on column C - e.g. =value(C2,"HH:MM:SS") in the adjacent column, and do the same with the values in the E columns, then I can do a sumproduct(countif formula and it's counting it correctly now

    I'm talking to myself here I guess lol but if anyone has a better method, please share - I'm all for learning

  5. #5
    Forum Contributor NewYears1978's Avatar
    Join Date
    03-15-2010
    Location
    Forney, TX
    MS-Off Ver
    Excel 2016
    Posts
    962

    Re: Help: I need a formula that counts how many cells in a range match another range

    Yeah I didn't notice it was not counting some of the values, and I am not sure why. Times are always wonky for me so now I am also trying to understand why it's not counting the 6:00:00 PM.

    It's a formatting issue with the critera column, if I paste that outside excel (like in notepad) then paste it back, it will count correctly.
    Attached Files Attached Files
    Last edited by NewYears1978; 06-02-2023 at 04:06 PM.

+ 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. Formula to look at a range of cells, match dates within the range and pull data.
    By mark.k.conroy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-04-2019, 10:20 AM
  2. create a variable i that counts number of cells in a range that start with 0
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2015, 08:30 PM
  3. Replies: 1
    Last Post: 05-21-2014, 02:30 PM
  4. formula that counts between a date range
    By Troutman12 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 08-09-2012, 01:54 AM
  5. Is there a function that counts the number of non-blank cells in a range?
    By xibalba in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-23-2012, 04:09 AM
  6. Replies: 4
    Last Post: 01-31-2012, 01:08 PM
  7. creating counts from a range of cells
    By tanbio in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-01-2006, 07:18 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