+ Reply to Thread
Results 1 to 3 of 3

Count rows which meet criteria

  1. #1
    Registered User
    Join Date
    03-24-2006
    Location
    Stafford, England
    MS-Off Ver
    Office 2003
    Posts
    70

    Count rows which meet criteria

    I am trying to count the number of rows that meet multiple criteria. For example if I had the following data

    ________A__________B____________C
    1_______Eh_______04/01/07_______04/04/07
    2_______Gb_______04/01/07_______04/04/07
    3_______Eh_______04/01/07_______04/09/07
    4_______Eh_______04/01/07_______04/06/07
    5_______Gb_______04/01/07_______04/04/07

    In the example above I want to be able to count the number of rows where there is an 'Eh' in column A and column C minus column B is <=7 (days). In the example I would want to return 2 (row 1 and row4).

    Any guidance would be appreciated.

    Thanks in advance.

    Jonathan

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good afternoon JonPugh

    Does this help your cause :
    =COUNT(IF(A1:A5="eh",IF(C1:C5-B1:B5<=7,0)))

    It's an array formula, so don't commit with just Enter - use Ctrl + Shift + Enter.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Registered User
    Join Date
    03-24-2006
    Location
    Stafford, England
    MS-Off Ver
    Office 2003
    Posts
    70

    Thanks for the help

    Hi DomininB,

    Thanks for your help. You pointed me in the right direction. It was not giving me the correct count with my 'real' data so I had to play around a bit. Eventually did the same as you but using the SUM function instead of COUNT.

    Thanks again.

    Jonathan

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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