+ Reply to Thread
Results 1 to 19 of 19

Countblank in B if criteria in A?

  1. #1
    Registered User
    Join Date
    09-09-2008
    Location
    Southampton
    Posts
    19

    Countblank in B if criteria in A?

    Can anyone tell me how to count blanks in column B if they are next to criteria in column A?

    PERSON 1 BLAH
    PERSON 1
    PERSON 1
    PERSON 1 BLAH
    PERSON 2
    PERSON 2 BLAH
    PERSON 2 BLAH
    PERSON 2

    I think I want something like if A:A = Person 1, then countblank in B:B?

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try something like:

    =SUMPRODUCT((A1:A8="Person 1")*(B1:B8=""))

    adjust ranges to suit
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    09-09-2008
    Location
    Southampton
    Posts
    19
    Thanks but that just comes up #VALUE!

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Are there any errors in the ranges you're looking at?

  5. #5
    Registered User
    Join Date
    09-09-2008
    Location
    Southampton
    Posts
    19
    No, at the moment they're exactly the same as in my first post.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Can you do me a favour and attach your sheet then?

  7. #7
    Registered User
    Join Date
    09-09-2008
    Location
    Southampton
    Posts
    19
    Sure

    and more text so I can post
    Attached Files Attached Files

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Not sure what you were doing to get that error.. but it worked for me...
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-09-2008
    Location
    Southampton
    Posts
    19
    Neither do I...but thanks!

  10. #10
    Registered User
    Join Date
    09-09-2008
    Location
    Southampton
    Posts
    19
    Actually I have another problem. I need this to reference A:A and B:B because the sheet will be constantly updated, and now it has names instead of person 1, person 2 etc. The formula doesn't work when I change it? Sorry, I don't know much about excel...
    Last edited by JessicaK; 09-19-2008 at 07:08 AM.

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Attach a sample workbook showing what you mean.

  12. #12
    Registered User
    Join Date
    09-09-2008
    Location
    Southampton
    Posts
    19
    Oops, sorry.
    Attached Files Attached Files

  13. #13
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    This doesn't work in I6, copied down?

    =SUMPRODUCT(($E$6:$E$31=H6)*($F$6:$F$31=""))

  14. #14
    Registered User
    Join Date
    09-09-2008
    Location
    Southampton
    Posts
    19
    I need E:E and F:F, when I enter that it doesn't work.

  15. #15
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    No that doesn't work... you are correct....

    Excel 2003 and earlier don't allow full column references like E:E... Excel 2007 does....

    You can use the entire column range -1 though.

    e.g.
    =SUMPRODUCT(($E$1:$E$65535=H6)*($F$1:$F$65535="")) or

    =SUMPRODUCT(($E$2:$E$65536=H6)*($F$2:$F$65536=""))

  16. #16
    Registered User
    Join Date
    09-09-2008
    Location
    Southampton
    Posts
    19
    Brilliant, thanks.

  17. #17
    Registered User
    Join Date
    01-30-2014
    Location
    Munich, Germany
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Countblank in B if criteria in A?

    Hi, Why use SUMPRODUCT instead of COUNTIFS?

    Thanks!

    PS. I'm a total Rookie trying to write Macros mostly with Record Macro and adding minor edits.

  18. #18
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,605

    Re: Countblank in B if criteria in A?

    When the OP started the thread there was no indication as to which version of XL he was using. To play it safe Vittorio used SUMPRODUCT.

    This being said, have a look at forum rules about hijacking threads. Although it is not strictly your case, we don't want to grow bad habits, don't we?

  19. #19
    Registered User
    Join Date
    01-30-2014
    Location
    Munich, Germany
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Countblank in B if criteria in A?

    Thanks Pepe Le Mokko. Sorry that my reply was delayed, vacation time .

+ 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. VLOOKUP to find next value greater than the criteria
    By blackjm75 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-23-2008, 11:20 AM
  2. Database criteria: Split cell ranges?
    By kmarnes in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-30-2008, 10:23 AM
  3. SUMIF with sequential criteria
    By steven314 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-06-2007, 07:41 PM
  4. select my criteria
    By ianternet in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-23-2007, 05:16 PM
  5. searching list using certain criteria from boxes
    By Andyd74 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-07-2006, 10:37 AM

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