+ Reply to Thread
Results 1 to 7 of 7

COUNTIF in an array with two cirteria (one of which is a date)

  1. #1
    Registered User
    Join Date
    01-30-2015
    Location
    Washington DC
    MS-Off Ver
    2010
    Posts
    37

    COUNTIF in an array with two cirteria (one of which is a date)

    Hello everyone,

    I'm trying to write a COUNTIF function with the following two criteria:

    1) Status is COMPLETE.
    2) Date to the left of the status falls within a certain range (i.e. specific quarter).

    Please see attached spreadsheet. I'm trying to figure out how to calculate the cells in yellow. I'm sure there must be an elegant solution to this where I can use the whole array as the range...but I'm having difficulty. Appreciate the help.

    Chris
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: COUNTIF in an array with two cirteria (one of which is a date)

    Which cells (none in yellow!!)?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    01-30-2015
    Location
    Washington DC
    MS-Off Ver
    2010
    Posts
    37

    Re: COUNTIF in an array with two cirteria (one of which is a date)

    B2-B5. Not sure why they lost their formatting...

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: COUNTIF in an array with two cirteria (one of which is a date)

    Trty this formula in B2 copied down to B5

    =COUNTIFS(C$9:I$12,"Complete",B$9:H$12,">="&E2,B$9:H$12,"<="&F2)
    Audere est facere

  5. #5
    Registered User
    Join Date
    01-30-2015
    Location
    Washington DC
    MS-Off Ver
    2010
    Posts
    37

    Re: COUNTIF in an array with two cirteria (one of which is a date)

    Thanks DLL. That does appear to work. Does it know that it's looking at side-by-side cells because the ranges are offset by 1?

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: COUNTIF in an array with two cirteria (one of which is a date)

    Quote Originally Posted by costgeek View Post
    Does it know that it's looking at side-by-side cells because the ranges are offset by 1?
    That's right, there's always a "one to one" relationship between the ranges so it's associating C9 with B9 and if all 3 conditions are satisfied for those cells 1 will be added to the total - that means it will also add one to the total if D9 contains "Complete" and C9 contains a valid date.......but presumably that can't be the case

  7. #7
    Registered User
    Join Date
    01-30-2015
    Location
    Washington DC
    MS-Off Ver
    2010
    Posts
    37

    Re: COUNTIF in an array with two cirteria (one of which is a date)

    Yeah, I protected the cells with data validation so that won't happen. You were a big help...I never would have figured that out on my own.

    Thanks again,
    Chris

+ 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. VBA to populate to specific cells based on cirteria
    By huard in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-08-2014, 07:41 AM
  2. Most Occuring Item based off other cell equal cirteria
    By keiserj in forum Excel General
    Replies: 12
    Last Post: 07-01-2014, 09:14 AM
  3. [SOLVED] Countif in an array
    By Petijandro in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-29-2013, 07:48 AM
  4. Combining a Date Range COUNTIF and a general COUNTIF
    By jacobtom in forum Excel General
    Replies: 1
    Last Post: 09-15-2011, 05:06 PM
  5. Countif Multiple Cirteria
    By Danielle 76 in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 09-06-2005, 07:05 PM

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