+ Reply to Thread
Results 1 to 5 of 5

Count occurrences of string in range, based on date range and other criteria

  1. #1
    Registered User
    Join Date
    07-19-2011
    Location
    Melbourne, Victoria
    MS-Off Ver
    Excel for Office 365 (Version 1907)
    Posts
    4

    Question Count occurrences of string in range, based on date range and other criteria

    Hi All,

    Can anyone help with a formula I'm struggling with? I've spent most of the day googling, but not got much closer to a solution.

    I'm trying to count the number of times a text string occurs in a multi-row table, based upon a date range in a separate row. To complicate matters there are a couple of other criteria that need to be met.

    So far, I've used COUNTIFS to create a helper table at the top of my sheet, that runs the full length of my data. The helper table counts the number of times the required strings occur in each column, where a criterion is met in another column. Then on a separate sheet I've used SUMIFS formula to add up only those values that fall within my required date range.

    I'm hoping to be able to return a value without using the helper table, so I remove the chance of someone overwriting the calculations on that sheet and also because I have the table running out to five years and I think this is what is causing the sheet to freeze when I try and insert a new line.

    Here's a simplified example of what I'm trying to do. I'm hoping to be able to be able to use a single formula in the blue shaded cell to be able to return the answer.

    Book 1.JPG

    I don't know if I've been able to explain what I'm trying to do very well. I tried to attach my original file but wasn't able to.

    Thanks in advance for reading!


    Neil
    Attached Files Attached Files
    Last edited by neilo1969; 08-09-2019 at 02:11 AM.

  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,779

    Re: Count occurrences of string in range, based on date range and other criteria

    Unfortunately the attachment icon doesn't work at the moment (it hasn't worked for years, and despite our repeatedly asking the technical team who own the forum to fix it, they can't be bothered to do so), so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    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
    07-19-2011
    Location
    Melbourne, Victoria
    MS-Off Ver
    Excel for Office 365 (Version 1907)
    Posts
    4

    Re: Count occurrences of string in range, based on date range and other criteria

    Thanks for the pointer Ali, I've attached a copy!

  4. #4
    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,779

    Re: Count occurrences of string in range, based on date range and other criteria

    I can't see anything like your image in that workbook. Can you tell us where we should be looking? Have you mocked up some expected results in the workbook to show us what you are after?

  5. #5
    Registered User
    Join Date
    07-19-2011
    Location
    Melbourne, Victoria
    MS-Off Ver
    Excel for Office 365 (Version 1907)
    Posts
    4

    Re: Count occurrences of string in range, based on date range and other criteria

    Here's the line of text that I removed when I didn't think I could attach a file.

    "I'd like to be able calculate the values on the "EVN Totals" sheet, in cells L8:L11, without having to use the helper table on the "Commercial" sheet (M2:BRT5)."

    The EVN Totals tab is where I'm aiming to summarise the bulk data from the "Commercial" tab, I'll ultimately be adding similar tabs for other teams. I'm trying to show total hours worked in each month for Males on Dayshift, Males on N/S, Females on D?S, Females on N/S

    I've been trying to do this by first counting the Days, which is done by summing the number of cells with D, IN-D and OUT-D that also show "M" in the gender column on the "Commercial" sheet and then by using SUMIFS on the EVN Totals tab to sum the values for the date range, finally multiplying by 12 as everyone works a 12 hour shift.

+ 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 duplicate occurrences based on another column within date range
    By chipper49 in forum Excel General
    Replies: 10
    Last Post: 06-10-2019, 04:05 PM
  2. Count occurrences of value in a date range I can specify easily each time
    By mikalaka in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 07-14-2014, 07:14 PM
  3. Replies: 0
    Last Post: 07-28-2013, 10:24 AM
  4. [SOLVED] Count based on 3 criteria including date range
    By timarcarze in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 06-13-2013, 01:43 AM
  5. [SOLVED] Count occurrences of a text string in a range of cells
    By skysurfer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-30-2012, 04:01 PM
  6. Formula to Count the Number of Occurrences of a Text String in a Range
    By poug1903 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-10-2011, 06:49 AM
  7. Replies: 1
    Last Post: 09-18-2009, 04:15 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