Formula to count how many cells contain data

Dazzawm

Well-known Member
Joined
Jan 24, 2011
Messages
3,783
Office Version
  1. 365
Platform
  1. Windows
I have data laid out as below, I need a formula that will count how many cells contain data please.

Excel 2010
YZAAABACADAEAF
TEE06TEE03911089110791106911049110291101
TEE069110791106911049110291101

<colgroup><col style="width: 25pxpx" https:="" www.mrexcel.com="" forum="" usertag.php?do="list&action=hash&hash=DAE7F5"" target="_blank"></colgroup><colgroup><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]2[/TD]

[TD="align: center"]3[/TD]

</tbody>
Sheet1


In this instance i would have a result of 8 in column AG2 and 6 in AG3
 
Last edited:

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
That's not giving anywhere near the desired results. Its giving 8 when there is just one cell with data, 1 when there is 2 cells with data...
 
Upvote 0
That's not giving anywhere near the desired results. Its giving 8 when there is just one cell with data, 1 when there is 2 cells with data...

This mean, that your data are result of a formula. You have to specify this in your first post.
You should have known (you have 3132 posts)

If your date are write in cells then counta formula is good.
 
Last edited:
Upvote 0
try if this work


Excel 2013/2016
YZAAABACADAEAFAGAH
1
2TEE06TEE039110891107911069110491102911018
3TEE0691107911069110491102911016
4
Sheet1
Cell Formulas
RangeFormula
AH2{=SUM(--(LEN(TRIM(Y2:AF2))>0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
try if this work

Excel 2013/2016
YZAAABACADAEAFAGAH
TEE06TEE03
TEE06

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]2[/TD]

[TD="align: right"]91108[/TD]
[TD="align: right"]91107[/TD]
[TD="align: right"]91106[/TD]
[TD="align: right"]91104[/TD]
[TD="align: right"]91102[/TD]
[TD="align: right"]91101[/TD]
[TD="align: right"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=E2EFDA]#E2EFDA[/URL] , align: right"]8[/TD]

[TD="align: center"]3[/TD]

[TD="align: right"][/TD]
[TD="align: right"]91107[/TD]
[TD="align: right"]91106[/TD]
[TD="align: right"]91104[/TD]
[TD="align: right"]91102[/TD]
[TD="align: right"]91101[/TD]
[TD="align: right"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=E2EFDA]#E2EFDA[/URL] , align: right"]6[/TD]

[TD="align: center"]4[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Array Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]AH2[/TH]
[TD="align: left"]{=SUM(--(LEN(TRIM(Y2:AF2))>0))}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]
Thanks that worked.
 
Upvote 0
Why should I? If I knew I wouldn't have been on requesting help.

Ahhhh, I forgot, you do not have to think, you are interested only how to get a solution to your problem, and it does not matter that those who want to help you lose time wondering why the solution does not work. For you, the others matter, only, if you get the answer you want.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,310
Members
452,634
Latest member
cpostell

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