+ Reply to Thread
Results 1 to 4 of 4

Ignore Spaces in "Blank" Cells

  1. #1
    Registered User
    Join Date
    08-06-2007
    Posts
    35

    Ignore Spaces in "Blank" Cells

    I have a cell with the formula =COUNTA('Survey Raw Data'!N2:N698) in it. On the "Survey Raw Data" worksheet, some of the cells in N2:N698 have a blank space entered into them (to stop 0 values from showing up elsewhere). Is there a way to make Excel NOT count those cells with blanks typed into them?

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

    =COUNTA('Survey Raw Data'!N2:N698)-COUNTIF('Survey Raw Data'!N2:N698," ")
    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
    Forum Contributor
    Join Date
    10-27-2006
    Location
    United Kingdom
    MS-Off Ver
    EXCEL 2003 (2007 at home)
    Posts
    517
    Try this:
    {=SUM(--(LEN(TRIM(N2:N698))>0))}
    i.e. type in =SUM(--(LEN(TRIM(N2:N698))>0)) then press ctrl shift and enter together.
    TRIM removes any spaces, thus blank cells have LEN=0 all non-blank cells have LEN>0.
    This gives a list of TRUE or FALSE for each cell in the range being blank or non blank, the -- forces EXCEL to interpret TRUE & FALSE as the numbers 1 and 0.
    Thus the SUM instruction gives the count of all the non-blank cells.
    pressing CTRL SHIFT and ENTER simultaneously tells EXCEL to process the instruction as an "ARRAY Formula".
    Otherwise TRIM(N2:N698) will only return TRIM(N2) rather than the whole array of results for the entire range (and similarly for LEN etc.).
    Mark

  4. #4
    Registered User
    Join Date
    08-06-2007
    Posts
    35
    Quote Originally Posted by NBVC
    one way...

    =COUNTA('Survey Raw Data'!N2:N698)-COUNTIF('Survey Raw Data'!N2:N698," ")
    That worked - thank you!

+ 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