Blank cells that do not appear blank cells when applying COUNTA with ROWS

mramo

New Member
Joined
Feb 17, 2015
Messages
14
Hi,

Following a data extract from master data system (file downloads as *.xlsx), I inserted a new row above each of my headers and performed a, "=COUNTA(A3:A816)/ROWS(A3:A816)" formula and formatted that cell as a Percentage. The idea is that the formula return me a % of the field that are populated in each column.

When I apply the formula, I receive a return value "100.00%" which is untrue. It seems the formula is treating the blank fields as data entered. When I mark over a blank cell and then press DEL button, the formula value finally drops to below 100%!

Why is this happening and how can I resolve this to ensure my blank cells are treated as blanks?

Screenshot as a simple example.
 

Attachments

  • Screenshot 2021-07-26 174254.jpg
    Screenshot 2021-07-26 174254.jpg
    9.5 KB · Views: 18
Last edited:

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Identify one of those "blank" cells. Let's say it is row A14.
Enter this formula somewhere in another column, and see what it returns:
Excel Formula:
=LEN(A14)

If it returns anything other than 0, then those cells which you think are blank are really not blank.
If they just contain a blank space, you can fix your data by doing a "Find/Replace", replacing all instances of a single space with nothing.

If it is not a blank space, then we need to figure out when is in there.
This code would tell us:
Excel Formula:
=ASC(A14)

Just let us know what value that formula returns.
 
Upvote 0
Hey Joe4, Pls see screenshot.

Performed these formulas against the blank cell under the header, Probationary Review.

Len is 0. When I click into that blank cell, no spacing exists within that cell.
When i try the ASC formula it returns a blank
 

Attachments

  • Screenshot 2021-07-26 175942.jpg
    Screenshot 2021-07-26 175942.jpg
    13.1 KB · Views: 10
Upvote 0
Maybe you copied the data from the network, sometimes "blank" cells contain control characters.
You can remove them with a macro.

check this:
 
Upvote 0
Len is 0. When I click into that blank cell, no spacing exists within that cell.
When i try the ASC formula it returns a blank
If that is indeed true, then COUNTA should work, as it should not count any cell that is completely empty.

Are you sure that you are applying your formula to the correct ranges?
In your original question, your formula references column A, but your image in your first post shows column O.
Then in your last post, it shows column AR.
 
Upvote 0
So what I ended up doing is, with no solution in place, was to simply perform a FIND/REPLACE to fill all the blanks with a unique set of characters, then perform another FIND/REPLACE and replace them back with BLANKS. That was the only way to resolve the issue but I will need to do this each time I wish to use the COUNTA/ROWS formula - until we go live with SuccessFactors next year - which I hope will not replicate the issue I am already having.

Thanks for all your help so far.
 
Upvote 0
Solution
So what I ended up doing is, with no solution in place, was to simply perform a FIND/REPLACE to fill all the blanks with a unique set of characters, then perform another FIND/REPLACE and replace them back with BLANKS. That was the only way to resolve the issue but I will need to do this each time I wish to use the COUNTA/ROWS formula - until we go live with SuccessFactors next year - which I hope will not replicate the issue I am already having.

Thanks for all your help so far.
It sounds like there is some weird stuff coming over on this file - not totally uncommon with Excel files being generated by other programs or coming from the web.

If you can upload a copy of the file to a file sharing site and provide a link to it in this thread, we can analyze your file and see if there is something we can do to help you avoid having to do those manual steps (note: even if that was not possible, we could create a macro that you could run to "clean-up" the data and put the formulas in there for you).
 
Upvote 0
Just messaged you privately.
It sounds like there is some weird stuff coming over on this file - not totally uncommon with Excel files being generated by other programs or coming from the web.

If you can upload a copy of the file to a file sharing site and provide a link to it in this thread, we can analyze your file and see if there is something we can do to help you avoid having to do those manual steps (note: even if that was not possible, we could create a macro that you could run to "clean-up" the data and put the formulas in there for you).
 
Upvote 0
I took at look at the file you sent, and I see what you are talking about.
COUNTA does not count blanks that are returned by formulas, or if they were formulas and copied over with Copy/Paste Special -> Values.
I am guessing something like this happened along the way.

Following what they did here: COUNTA() formula Not working as expected
try changing all instances of:
Excel Formula:
COUNTA(B3:B816)
like this:
Excel Formula:
=COUNTIF(B3:B816,"*?")
 
Upvote 0

Forum statistics

Threads
1,214,426
Messages
6,119,417
Members
448,895
Latest member
omarahmed1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top