+ Reply to Thread
Results 1 to 14 of 14

Count of specific values in a date range

  1. #1
    Registered User
    Join Date
    06-23-2006
    Location
    UK
    Posts
    23

    Count of specific values in a date range

    Hi

    Col A has a list of dates UK Format dd/mm/yyyy

    Col C has a unique local codein each cell which is always in the following format 1 xxx yyy (one number and 2 sets of three letters)

    I would like a formula that will return how many times the number one occurs in any given month, The attached picture use Feb as an example.

    I also want a formula that will return a count of abc and a separate count of yyy.

    Hope the picture is obvious

    screen.jpg

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Count of specific values in a date range

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic


    You probably need the COUTIFS and/or COUNTIF function

  3. #3
    Registered User
    Join Date
    06-23-2006
    Location
    UK
    Posts
    23

    Re: Count of specific values in a date range

    I have attached a sample file.

    I forgot to mention i need the formula to be compatible with Excel 2003 (Dont ask company policy)
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,199

    Re: Count of specific values in a date range

    Try

    =SUMPRODUCT((ISNUMBER(SEARCH("1",$C$1:$C$12)))*(MONTH($A$1:$A$12)=2))

    Change "1" to "abc" and "yyy"

  5. #5
    Registered User
    Join Date
    06-23-2006
    Location
    UK
    Posts
    23

    Re: Count of specific values in a date range

    John

    Magic, works a treat. Many Thanks.

  6. #6
    Registered User
    Join Date
    06-23-2006
    Location
    UK
    Posts
    23

    Re: Count of specific values in a date range

    John

    your solution works a treat but I have now moved on and need more search criteria.

    So

    =SUMPRODUCT((ISNUMBER(SEARCH("1",$C$1:$C$12)))*(MONTH($A$1:$A$12)=2)) will find "1" in Col C1-C12 for Feb

    Can I seach for "1" in Col C1-C12 AND "a" in Col D1-D12 for Feb. So the result would only be positve if all three conditions were met?

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count of specific values in a date range

    Try this...

    =SUMPRODUCT(--ISNUMBER(FIND(1,C$1:C$12)),--ISNUMBER(SEARCH("A",D$1:D$12)),--(MONTH(A$1:A$12)=2))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  8. #8
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Count of specific values in a date range

    Please Login or Register  to view this content.
    =COUNTIFS(C$1:C$12,"*1*",D$1:D$12,">="&DATE(2015,2,1),D$1:D$12,"<"&DATE(2015,3,1))
    try this
    It will not work in 2003 version, sorry ignore it
    Last edited by samba_ravi; 11-24-2015 at 06:04 AM.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count of specific values in a date range

    Quote Originally Posted by nflsales View Post
    =COUNTIFS(C$1:C$12,"*1*",D$1:D$12,">="&DATE(2015,2,1),D$1:D$12,"<"&DATE(2015,3,1))
    I think you missed this:

    Quote Originally Posted by bobbych View Post
    I forgot to mention i need the formula to be compatible with Excel 2003

  10. #10
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Count of specific values in a date range

    you are right @ Tony Valko, I missed the OP comment.

  11. #11
    Registered User
    Join Date
    11-24-2015
    Location
    Delhi, India
    MS-Off Ver
    2013
    Posts
    5

    Re: Count of specific values in a date range

    =COUNTIFS($C$1:$C$12,"*def*",$A$1:$A$12,">="&DATE(2015,2,1),$A$1:$A$12,"<"&DATE(2015,3,1))

  12. #12
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count of specific values in a date range

    Quote Originally Posted by Nitin.Agr View Post
    =COUNTIFS($C$1:$C$12,"*def*",$A$1:$A$12,">="&DATE(2015,2,1),$A$1:$A$12,"<"&DATE(2015,3,1))
    Looks like you also missed this:

    Quote Originally Posted by bobbych View Post
    I forgot to mention i need the formula to be compatible with Excel 2003

  13. #13
    Registered User
    Join Date
    06-23-2006
    Location
    UK
    Posts
    23

    Re: Count of specific values in a date range

    Managed to get this to work so all sorted now. Thanks for all the help. much appreciated.

    =SUMPRODUCT(--(ISNUMBER(SEARCH("abc",$C$1:$C$12)))*(ISNUMBER(SEARCH("def",$D$1:$D$12)))*(MONTH($A$1:A$12)=1))

  14. #14
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count of specific values in a date range

    You're welcome. Thanks for the feedback!

+ 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 number of values dependent between horizontal date range based on 2 date values
    By dcad81 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-06-2015, 08:16 AM
  2. Count values in a row pertaining to a specific date range column
    By MattStolz in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-23-2015, 03:21 PM
  3. [SOLVED] Count cells within a specific date range that contain a specific word
    By oneillp1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-23-2014, 08:34 AM
  4. [SOLVED] Count unique values on a specific date
    By Even in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-21-2014, 02:05 PM
  5. Replies: 1
    Last Post: 02-05-2013, 09:14 AM
  6. Count values in a range that appear for specific dates
    By galvinpaddy in forum Excel General
    Replies: 1
    Last Post: 11-02-2011, 03:45 PM
  7. count specific values in a range
    By tammy25 in forum Excel General
    Replies: 6
    Last Post: 09-01-2011, 08:09 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