+ Reply to Thread
Results 1 to 9 of 9

Countif

  1. #1
    Registered User
    Join Date
    05-30-2007
    Posts
    7

    Countif

    I need to create a formula which will count the number of cells in a particular range which contain a certain value, but only count the ones where a corresponding cell in another column is blank.

    i.e Count all cells in column j which contain the value "review" but only if the corresponing cell in row b is blank

    Many thanks

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454
    Hi,

    This array formula will do what you require, presuming your data is in B1:B11 and J1:J11.


    =COUNT(IF(ISBLANK(B1:B11),IF(J1:J11="review",1,""),""))

    paste this into your workbook, and press SHIFT, CTRL and ENTER to confirm it. It should appear in the bar like this:

    {=COUNT(IF(ISBLANK(B1:B11),IF(J1:J11="review",1,""),""))}
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,719
    Perhaps

    =SUMPRODUCT(--(B1:B100=""),--(J1:J100="Review"))

    adjust ranges as necessary

  4. #4
    Registered User
    Join Date
    05-30-2007
    Posts
    7
    tried both, neither work.

    I think i'm just a dunce.

    I need to count the number of cells with the text REVIEW in them in column J, but only count them if the corresponding field in row M is blank. So if J9 has "review" in it but M9 has a date in it, I don't want it counted.

    However if J11 has got REVIEW in it and M11 is blank I want that to be added.
    Last edited by omar.b; 05-30-2007 at 05:28 AM.

  5. #5
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454
    you were talking about columns B and J before:

    =COUNT(IF(ISBLANK(B1:B11),IF(M1:M11="review",1,"") ,"")) with CTRL, SHIFT and ENTER.

    If that doesn't work, please zip and post an example.


    Dave

  6. #6
    Registered User
    Join Date
    05-30-2007
    Posts
    7
    sorry, about that, having a hard day.

    Very grateful for your help.

    Just one more, what if I now want to count the number of cells in column J with Review in but now only if the corresponding cell in Column M contains a date (any date)

    Many thanks

  7. #7
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454
    No problem - you've gotta have hard days to know what an easy one feels like!


    =COUNT(IF(ISBLANK(M1:M11),"",IF(J1:J11="review",1,""))), again with CTRL, SHIFT and ENTER

    will display as {=COUNT(IF(ISBLANK(M1:M11),"",IF(J1:J11="review",1,"")))}

    Let me know if it works?

    Dave
    Last edited by sweep; 05-30-2007 at 05:53 AM.

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,719
    Quote Originally Posted by omar.b
    what if I now want to count the number of cells in column J with Review in but now only if the corresponding cell in Column M contains a date (any date)
    Try

    =SUMPRODUCT(--ISNUMBER(M1:M100),--(J1:J100="Review"))

  9. #9
    Registered User
    Join Date
    05-30-2007
    Posts
    7
    very many thanks people.

+ 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