ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Counting entries in a cell (https://www.excelbanter.com/excel-programming/293216-counting-entries-cell.html)

Tom

Counting entries in a cell
 
We often use a cell as an "adding machine" and would have
an enrty such as

=12+2+45+32+14

The result would obviously return the value of 105

Can anyone think of a way to COUNT the number of entries
(in this case 5) so that the frequency or average could
automatically be calculated ?

Thanks for the help.

Tom Ogilvy

Counting entries in a cell
 
numitems =
len(cell.formula)-len(application.substitute(cell.formula,"+",""))+1

if numItems 0 then
avg = cell.value / numItems

--
Regards,
Tom Ogilvy

"Tom" wrote in message
...
We often use a cell as an "adding machine" and would have
an enrty such as

=12+2+45+32+14

The result would obviously return the value of 105

Can anyone think of a way to COUNT the number of entries
(in this case 5) so that the frequency or average could
automatically be calculated ?

Thanks for the help.





All times are GMT +1. The time now is 05:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com