1. Welcome to Chandoo.org Forums. Short message for you

    Hi Guest,

    Thanks for joining Chandoo.org forums. We are here to make you awesome in Excel. Before you post your first question, please read this short introduction guide. When posting or responding to questions please remember our values at Chandoo.org are: Humility, Passion, Fun, Awesomeness, Simplicity, Sharing Remember that we have people here for whom English is not there first language and we need to allow for this in our dealings.

    Yours,
    Chandoo
  2. Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  3. When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

CSV file with non-blank empty cells

Discussion in 'Ask an Excel Question' started by ashillz, Nov 8, 2018.

  1. ashillz

    ashillz New Member

    Messages:
    2
    Hi All:

    I have exported to .csv some data from a database that I am trying to gain some basic insights into (% of fields populated, for example). It appears that every cell with no value is formatted in a strange way that it does not register as a blank cell when using formulas like COUNTA(). I was curious if anyone had a suggestion on how to systematically correct these 'blank' cells. My current approach of filtering each column for blanks, selecting those blank cells and hitting 'Clear' is not feasible on a file with many columns.

    Please see the attached sample file that demonstrates the problem here. Thanks for the help!

    ashillz

    Attached Files:

  2. Chihiro

    Chihiro Excel Ninja

    Messages:
    5,053
    Welcome to the forum.

    Use COUNTIF() instead of COUNTA().

    Ex: In K8
    =COUNTIF(OFFSET($B$4,1,ROWS(J$5:J8)-1,26,1),"?*")

    ? is any text (not numbers), * as wild card.

    So counting only cells with at least one character.
  3. ashillz

    ashillz New Member

    Messages:
    2
    The approach mentioned by Chihiro seems to work on all fields in the sample file, with the exception of 'Id'. Is there a slight modification to this approach that will support number, text, and date values?
  4. John Jairo V

    John Jairo V Well-Known Member

    Messages:
    501
    Hi, to both!

    You could try:
    [K5] : =SUM(COUNTIF(INDEX(B$5:F$30,,ROWS(K$5:K5)),{"?*";">0"}))

    And drag it down. Blessings!
    Chihiro likes this.
  5. Chihiro

    Chihiro Excel Ninja

    Messages:
    5,053
    Though I'd recommend John's method. Another method is to add COUNTIF(Range,">0") to the formula.
    Ex:
    =COUNTIF(OFFSET($B$4,1,ROWS(J$5:J8)-1,26,1),"?*")+COUNTIF(OFFSET($B$4,1,ROWS(J$5:J8)-1,26,1),">0")

Share This Page