+ Reply to Thread
Results 1 to 5 of 5

Countif value in cell is found in another range whilst two sets of dates also match..

  1. #1
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Countif value in cell is found in another range whilst two sets of dates also match..

    Hi,

    I've tried but I cant get my brain round this.......Im sure the solution is fairly easy but *sigh*!

    I need to count the number of times a value in A2 appears in F2:F20, as well as the dates (on the same row) in J2:J20 and K2:K20 fall between the dates in E2 and F2.

    I've attached an example sheet, hopefully it will be obvious when you see it

    The answer in the example sheet would be 2!

    test.xlsx

  2. #2
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Countif value in cell is found in another range whilst two sets of dates also match..

    Hi,

    Try the following in D2:

    =COUNTIFS(F$1:F$4,A2,G$1:G$4,">="&B2,H$1:H$4,"<="&C2)

  3. #3
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Countif value in cell is found in another range whilst two sets of dates also match..

    OR,

    In D2:

    =SUMPRODUCT((F$1:F$4=A2)*(G$1:G$4>=B2)*(H$1:H$4<=C2))

  4. #4
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Re: Countif value in cell is found in another range whilst two sets of dates also match..

    Thanks! That's great. It's fair to say I would never have worked that out

  5. #5
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Countif value in cell is found in another range whilst two sets of dates also match..

    You are welcome

    If that takes care of your question, please mark this thread as Solved by selecting Thread Tools --> Mark thread as solved.

    Also, you can directly thank those who have helped you by clicking on the small * (star) icon located in the lower left corner of a post that you have found to be helpful.

+ 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] Return Value from string if it Match is Found in Range
    By Jonathan78 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-17-2015, 10:05 AM
  2. Replies: 4
    Last Post: 08-04-2014, 04:48 AM
  3. Replies: 3
    Last Post: 10-30-2013, 10:30 AM
  4. [SOLVED] Search for dates whilst ignoring earlier dates for servicing
    By Ju1cy in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 05-10-2013, 11:05 AM
  5. [SOLVED] Match one cell with another, if match found copy adjacent cells
    By Xiophoid in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-07-2013, 05:50 AM
  6. Excel 2007 : Linking Data Sets using Dates and Date Range
    By fgrubercpa in forum Excel General
    Replies: 0
    Last Post: 12-21-2011, 12:09 AM
  7. Autofill macro: filling for range whilst there is a value in cell
    By maff in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-25-2008, 07:34 AM

Tags for this Thread

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