+ Reply to Thread
Results 1 to 3 of 3

How to count rows where one column meets criteria based on another column

  1. #1
    Registered User
    Join Date
    07-08-2018
    Location
    UK
    MS-Off Ver
    Excel 2016
    Posts
    1

    How to count rows where one column meets criteria based on another column

    Hello,

    Attached is a sample data sheet. It has three columns: Site, Date Started, Date Visited. I am from the UK, so date format is dd/mm/yyyy.

    I want to count all occurrences where the Date Visited is within a defined period and within 6 months of the Date Started.

    Using the sample data, I'd like to count number of rows where Date Visited was between 01/01/2018 and 30/04/2018 and Date Visited was within 6 months of the Date Started.

    I think it can be done with COUNTIFS and EDATE functions... but it's just not happening for me, please help!

    Cheers
    Attached Files Attached Files

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

    Re: How to count rows where one column meets criteria based on another column

    Welcome to the forum!

    Is the 6 month thing necessary? With start and finish dates (cirteria) that span only four months, isn't that criterion moot?

    (EDIT: forget that - misread the requirement.)

    One critical bit of info is missing: what's your expected result for the sample data?
    Last edited by AliGW; 07-08-2018 at 07:40 AM.
    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
    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,786

    Re: How to count rows where one column meets criteria based on another column

    With a helper column, which could be hidden:

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    D
    E
    F
    G
    1
    Site Date Started Date visited
    2
    1
    12/07/2017
    01/04/2018
    FALSE
    Start Date:
    01/01/2018
    3
    2
    01/02/2018
    05/04/2018
    TRUE
    Finish Date:
    30/04/2018
    4
    3
    03/12/2017
    10/01/2018
    TRUE
    Within (Months):
    6
    5
    4
    16/04/2018
    18/05/2018
    TRUE
    6
    5
    19/08/2016
    05/12/2017
    FALSE
    Count:
    2
    Sheet: Sheet1

    Excel 2016 (Windows) 32 bit
    D
    2
    =C2<=EDATE(B2,G$4)
    Sheet: Sheet1
    G
    6
    =COUNTIFS($C$2:$C$6,">="&G2,$C$2:$C$6,"<="&G3,$D$2:$D$6,TRUE)
    Sheet: Sheet1
    Last edited by AliGW; 07-08-2018 at 07:42 AM.

+ 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 Items in Column If Meets Criteria on Another Sheet
    By CWatsonJr in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-02-2015, 01:16 AM
  2. Automatically Move Rows When one Column meets a Criteria
    By Apokolips in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-24-2013, 09:55 PM
  3. Count unique values in a column for each row that meets 3 criteria
    By xtomg19 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-18-2012, 12:15 AM
  4. Trying to count every second cell in a column that meets certain criteria
    By RalphCr in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-08-2012, 08:40 AM
  5. [SOLVED] Trying to count cells greater than # in one column if another column meets criteria
    By lorne17 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-14-2012, 07:01 PM
  6. Count items in column B if column c meets criteria
    By loki11 in forum Excel General
    Replies: 3
    Last Post: 01-17-2012, 09:20 AM
  7. Count the number of rows where more than one column meets set crit
    By BarrieVoice in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-14-2006, 02:30 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