+ Reply to Thread
Results 1 to 12 of 12

Criteria for non-blank

  1. #1
    Forum Contributor
    Join Date
    08-22-2013
    Location
    US
    MS-Off Ver
    Mac Version 2011
    Posts
    126

    Criteria for non-blank

    Hi guys,

    I have a range of values that contains blanks and non-blanks. Blanks are results of v-lookup formula. When I tried to use "<>" as criteria to calculate the number of non-blanks and their revenues, it did not work. Any idea? What should I use instead of "<>"?
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Criteria for non-blank

    did you try just plain ol...
    =COUNT(A2:A6)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    08-22-2013
    Location
    US
    MS-Off Ver
    Mac Version 2011
    Posts
    126

    Re: Criteria for non-blank

    Hi FDibbins,

    I did, that worked to calculate the number, but if I want to use sumif with criteria, what should I use?

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Criteria for non-blank

    If you are summing the data, then the blanks wont be included anyway?

  5. #5
    Forum Contributor
    Join Date
    08-22-2013
    Location
    US
    MS-Off Ver
    Mac Version 2011
    Posts
    126

    Re: Criteria for non-blank

    Hi FDibbins,

    The column with blanks is criteria, and I'm summing another column based on this column. Sorry if I am confusing you.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Criteria for non-blank

    Normally, a SUMIF like this should work:

    =SUMIF(A2:A6,"<>",B2:B6)

    However, in your sample file there is some kind of unseen whitespace characters in cells A3 and A4.

    If you clear the contents of those cells the formula above will work.

    An alternative that works on the data as-is:

    =SUMPRODUCT(--(A2:A6<>""),B2:B6)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Forum Contributor
    Join Date
    08-22-2013
    Location
    US
    MS-Off Ver
    Mac Version 2011
    Posts
    126

    Re: Criteria for non-blank

    Hi Tony,

    Those blanks are the results of v-lookup. That is why I could not just use "<>" as normal.

  8. #8
    Forum Contributor
    Join Date
    08-22-2013
    Location
    US
    MS-Off Ver
    Mac Version 2011
    Posts
    126

    Re: Criteria for non-blank

    Tony,

    I think your formula did it. Thanks so much!

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Criteria for non-blank

    Did you try the SUMPRODUCT version and did it work?

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Criteria for non-blank

    Quote Originally Posted by huy_le View Post
    Tony,

    I think your formula did it. Thanks so much!
    You're welcome. Thanks for the feedback!

  11. #11
    Forum Contributor
    Join Date
    08-22-2013
    Location
    US
    MS-Off Ver
    Mac Version 2011
    Posts
    126

    Re: Criteria for non-blank

    Yes, the sumproduct worked.

  12. #12
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Criteria for non-blank

    Good deal. Thanks for the feedback!

+ 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] Autofilter with multiple criteria - how to ignore blank criteria
    By MOONDRIFT47 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-31-2012, 12:20 PM
  2. SUMIFS Not Blank Criteria
    By philwilliams80 in forum Excel General
    Replies: 3
    Last Post: 09-30-2011, 11:27 AM
  3. Replies: 5
    Last Post: 09-07-2011, 11:14 PM
  4. sumif for non-blank criteria
    By dellphinus in forum Excel General
    Replies: 10
    Last Post: 11-03-2008, 08:03 AM
  5. Blank cell criteria
    By Annette in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-22-2005, 11:06 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