+ Reply to Thread
Results 1 to 7 of 7

COUNTIF or COUNTBLANKIF

  1. #1
    Registered User
    Join Date
    06-28-2010
    Location
    London, Englans
    MS-Off Ver
    Excel 2007
    Posts
    16

    Talking COUNTIF or COUNTBLANKIF

    Hi all,

    Im trying to count the cells in row where the cells fit criteria in column A

    {=COUNT(IF((MONTH('Summary Cleaned up'!$A$4:$A$968)=D$2)*(YEAR('Summary Cleaned up'!$A$4:$A$968)=D$3),'Summary Cleaned up'!$B$4:$B$968))}

    Col A houses a few years of consecutive dates
    Col B contains values and blanks

    D2 that I ref above contains the Month number and D3 has the year

    A good example is where September 2009 has lets say 15 days with values the output would be 15 but with the above it seems to count the number of days that 30

    I would be happy with countblank and have tried

    {=COUNTBLANK(IF((MONTH('Summary Cleaned up'!$A$4:$A$968)=D$2)*(YEAR('Summary Cleaned up'!$A$4:$A$968)=D$3),'Summary Cleaned up'!$B$4:$B$968))}

    but this does the same as the other formula..

    Thanks a lot for your help.

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: COUNTIF or COUNTBLANKIF

    Are you just tring to get how many dates in column A fit the Month/Year criteria? It looks that way because you have no criteria associated with the B range. If so, you could use:

    =COUNTIF(A:A,">="&DATE(D3,D2,1))-COUNTIF(A:A,">"&EOMONTH(DATE(D3,D2,1),0))
    or
    =COUNTIFS(A:A,">="&DATE(D3,D2,1),A:A,"<="&EOMONTH(DATE(D3,D2,1),0))

    You can use this if you want to count how many cells in B are occupied and dates match
    =COUNTIFS(A:A,">="&DATE(D3,D2,1),A:A,"<="&EOMONTH(DATE(D3,D2,1),0),B:B,"<>"&"")
    or this for cells in B that are blank and dates match
    =COUNTIFS(A:A,">="&DATE(D3,D2,1),A:A,"<="&EOMONTH(DATE(D3,D2,1),0),B:B,"="&"")
    Last edited by Cutter; 04-23-2012 at 04:41 PM. Reason: Added formulas

  3. #3
    Registered User
    Join Date
    06-28-2010
    Location
    London, Englans
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: COUNTIF or COUNTBLANKIF

    Thanks Cutter,

    Column A has dates from 01/09/2009 to present day so around 980 rows of data
    Column B has values but there are a lot of missing entries,

    Im trying to find out for the specified month and year how many missing entries there are in column B. So could be counting the blanks or counting the entries in B that fit the criteria specified in D2 and D3

    If it wasnt for the need to specify the Month and Year as criteria from column A the

    =COUNTBLANK('Summary Cleaned up'!B4:B33) works perfectly

    Hope that helps with explaining it!

    Looking at the formula its completely different to my original ones.

    Regards

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: COUNTIF or COUNTBLANKIF

    Yes, the formulas I gave are different. You are using array formulas but you may not need them.
    Will this be used in an Excel version prior to 2007? If not, the last formula I gave you will tell you how many B cells are blank for the given time period.

    You could also use a SUMPRODUCT() but try to stay away from array formulas unless they are necessary.

  5. #5
    Registered User
    Join Date
    06-28-2010
    Location
    London, Englans
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: COUNTIF or COUNTBLANKIF

    Thanks again for your reply

    I am using version 2003 unfortunately, can you help me with the best one for that? Does the sumproduct approach work with an array?

    Regards

  6. #6
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: COUNTIF or COUNTBLANKIF

    Try this.

    For the Blank

    Please Login or Register  to view this content.
    For Non Blank,

    Please Login or Register  to view this content.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  7. #7
    Registered User
    Join Date
    06-28-2010
    Location
    London, Englans
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: COUNTIF or COUNTBLANKIF

    Thanks for your help the first solution works great. Why us there three ;;; in the formula?
    Regards

+ 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