Go Premium for a chance to win a PS4. Enter to Win

x
Solved

# Limit COUNTA fn to cells whose formula returns any text

Posted on 2011-02-25
Medium Priority
326 Views
I have a spreadsheet which contains formulas down column A to pull in names from another spreadsheet column A.  I will refer to the other spreadsheet as [other].  Each cell in column A contains an IF statement =if([other]A1="","",[other]A1).  The spreadsheet column A looks like:

COLUMN A
ROW 1:  Name 1
ROW 2:  Name 2
ROW 3:  Name 3
ROW 4:  Name 4
ROW 5:
ROW 6:

My problem is that at the bottom of column A, I want to count how many names I have, and not include any cells that contain merely the if statement.  A normal COUNTA(A1:A6) will return 6 but I need it to return 4.

How do I limit the COUNTA function in this way?  Or should I be doing it another way?
0
Question by:witzph1
• 4
• 3

LVL 33

Expert Comment

ID: 34984442
0

Author Comment

ID: 34984460
COUNT returns '0' because it is looking for numbers, not text.
0

LVL 33

Expert Comment

ID: 34984467
Sorry...forgot that you're counting text!
0

LVL 93

Accepted Solution

Patrick Matthews earned 1000 total points
ID: 34984492
Try this:

=COUNTIF(A:A,"?*")

That will ignore blanks, zero-length strings, and numbers.
0

LVL 33

Expert Comment

ID: 34984500
=COUNTA(A1:A8)-COUNTBLANK(A1:A8)
0

Author Comment

ID: 34984545
Mathewspatrick, that works, but not sure I understand why "?*" does what it does.  Very interesting.

ippinto, that also works.  Alas, Mathewspatrick was slightly quicker on the draw, and his solution is shorter, and thus more elegant.

But thanks to both for your help!
0

Author Closing Comment

ID: 34984549
0

LVL 33

Expert Comment

ID: 34984574
Agree! I almost got there... :)
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calculâ€¦
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
###### Suggested Courses
Course of the Month7 days, 22 hours left to enroll