# Count of all non-blank rows in all remaining columns in a specified range, based on the filter in first column

#### TanviP

##### New Member
I have 4 columns like:
 Team 1

<tbody>
</tbody>
 Team 2

<tbody>
</tbody>
 Team 3

<tbody>
</tbody>
 Name

<tbody>
</tbody>
 John

<tbody>
</tbody>
 Shaun

<tbody>
</tbody>
 Haley

<tbody>
</tbody>
 Mike

<tbody>
</tbody>
 Divya

<tbody>
</tbody>
Brittany
 Alex

<tbody>
</tbody>
 Molly

<tbody>
</tbody>
 School

<tbody>
</tbody>
 ABC

<tbody>
</tbody>
 DEF

<tbody>
</tbody>
 DEF

<tbody>
</tbody>
 GHI

<tbody>
</tbody>
 ABC

<tbody>
</tbody>

<tbody>
</tbody>

I need to find count of non blank rows in Team 1, Team 2, and Team 3, but filtered by the Name and School.
The result should look like:

 Team 1 Team 2 Team 3 Name John Shaun Haley Mike Divya Brittany Alex Molly 3 2 3 School ABC DEF DEF GHI ABC 2 3 0

<tbody>
</tbody>

### Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

#### Jobolobo

##### New Member
Hey TanviP,

Maybe give this a go. Using the "CountA" formula at the bottom of each of your columns.

CountA will count the non blank cells.

Code:
``=CountA(Range)``

 A B C D 1 Team 1 Team 2 Team 3 2 John Shaun Haley 3 Name Mike Dyvia Brittany 4 Alex Molly 5 =CountA(B2:B4) =CountA(C2:C4) =CountA(D2:D4)

<tbody>
</tbody>

The results should show a count of the non blank cells in each column.

#### TanviP

##### New Member
I need to write a macro for this to be done automatically on the click of a button. And I'm new to Excel and VBA

#### TanviP

##### New Member
I need to write a macro for this to be done automatically on the click of a button. And I'm new to Excel and <acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">VBA</acronym>

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,164,632
Messages
5,838,479
Members
430,549
Latest member
jayjay2022

### 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.

### Which adblocker are you using?

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

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