+ Reply to Thread
Results 1 to 4 of 4

COUNTIF with OR blank cell, less than cell

  1. #1
    Registered User
    Join Date
    08-10-2016
    Location
    Boston, US
    MS-Off Ver
    2013
    Posts
    2

    COUNTIF with OR blank cell, less than cell

    I'm pulling a count of stores that were closed before a certain date, or still active (no close date). I can get it to count only the blanks, or only stores closed before the date, but not ones that are either or. Here's my best guess at it:

    =COUNTIFS(Stores!$E:$E,Summary!B6,Stores!$G:$G,{"<="&$C$3,""})

    Column E is store name, Column G is close date. I'm probably missing something simple here...

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: COUNTIF with OR blank cell, less than cell

    Try reversing the logic...

    count the ones that ARE > C3, and subtract that from the Total
    Logically, that will be equal to the ones that are <=C3 OR blank..

    =COUNTIF(Stores!$E:$E,Summary!B6)-COUNTIFS(Stores!$E:$E,Summary!B6,Stores!$G:$G,">"&$C$3)

  3. #3
    Registered User
    Join Date
    08-10-2016
    Location
    Boston, US
    MS-Off Ver
    2013
    Posts
    2

    Re: COUNTIF with OR blank cell, less than cell

    Thanks!! That logic worked! You rock.

    FYI here's the final formula I used to find stores that closed between 2 periods. I added that to make it more dynamic to use, i.e. in the last 3 months, 12 months, etc.

    =COUNTIFS('Stores'!$E:$E,'Summary'!B7)-COUNTIFS('Stores'!$E:$E,'Summary'!B7,'Stores'!$G:$G,"<="&$C$4)

    where C3 is start of period and C4 is end of period.

    Thx again

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: COUNTIF with OR blank cell, less than cell

    You're welcome.

+ 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] Countif until blank cell (mutiple blank cells)
    By plasma33 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-07-2015, 01:14 PM
  2. [SOLVED] How to COUNTIF cells where data is below a date or the cell is blank?
    By cpyter in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-11-2014, 12:41 PM
  3. How do i make my Countif function skip counting a blank cell
    By Renildrah in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-20-2014, 05:00 AM
  4. Replies: 3
    Last Post: 08-20-2013, 10:39 AM
  5. Show blank cell in countif = 0
    By korny5589 in forum Excel General
    Replies: 6
    Last Post: 07-18-2011, 11:38 PM
  6. Countif only when a cell is blank.
    By Stevie-B in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-03-2008, 10:58 AM
  7. [SOLVED] COUNTIF, dates and blank cell criteria
    By luvthavodka in forum Excel General
    Replies: 6
    Last Post: 06-01-2006, 04:55 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