Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 25
Default Count number of inputs

Hello,

I have a table with 3 rows with a multitude of columns. If we look at one
column, each cell is simply the summation of values (ie: =120+65+15)

So I end up with a a column looking with totals looking like

220
125
347

Is there a awy to, in a cell below the table, have the count of inputs or
elements used in the summations? If with look at the formulas used for the
example above

Ie:
=100+120
=25+75+25
=300+47

Have a cell which would return the value/number 7 (2 elements for the 1st
summation, 3 elements for the 1st summation, 2 elements for the 1st
summation) as the total number of elements.

Thank you,

QB
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Count number of inputs

For the simple formulas in your posting, the number of inputs in an
individual cell is just the number of "connectors" ("+" or "-") plus one. We
create a UDF that counts the number of "connectors" in a range of cells and
does the math:

Function IAmTheCount(rr As Range) As Integer
IAmTheCount = 0
For Each r In rr
v = r.Formula
v2 = Replace(Replace(v, "+", ""), "-", "")
n = Len(v) - Len(v2)
IAmTheCount = IAmTheCount + 1 + n
Next
End Function

--
Gary''s Student - gsnu200769


"Question Boy" wrote:

Hello,

I have a table with 3 rows with a multitude of columns. If we look at one
column, each cell is simply the summation of values (ie: =120+65+15)

So I end up with a a column looking with totals looking like

220
125
347

Is there a awy to, in a cell below the table, have the count of inputs or
elements used in the summations? If with look at the formulas used for the
example above

Ie:
=100+120
=25+75+25
=300+47

Have a cell which would return the value/number 7 (2 elements for the 1st
summation, 3 elements for the 1st summation, 2 elements for the 1st
summation) as the total number of elements.

Thank you,

QB

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 25
Default Count number of inputs

Thank you, with a minor mod (for my needs - ignore blank cells) it worked
like a charm!

QB



"Gary''s Student" wrote:

For the simple formulas in your posting, the number of inputs in an
individual cell is just the number of "connectors" ("+" or "-") plus one. We
create a UDF that counts the number of "connectors" in a range of cells and
does the math:

Function IAmTheCount(rr As Range) As Integer
IAmTheCount = 0
For Each r In rr
v = r.Formula
v2 = Replace(Replace(v, "+", ""), "-", "")
n = Len(v) - Len(v2)
IAmTheCount = IAmTheCount + 1 + n
Next
End Function

--
Gary''s Student - gsnu200769


"Question Boy" wrote:

Hello,

I have a table with 3 rows with a multitude of columns. If we look at one
column, each cell is simply the summation of values (ie: =120+65+15)

So I end up with a a column looking with totals looking like

220
125
347

Is there a awy to, in a cell below the table, have the count of inputs or
elements used in the summations? If with look at the formulas used for the
example above

Ie:
=100+120
=25+75+25
=300+47

Have a cell which would return the value/number 7 (2 elements for the 1st
summation, 3 elements for the 1st summation, 2 elements for the 1st
summation) as the total number of elements.

Thank you,

QB

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count rows and insert number to count them. Mex Excel Discussion (Misc queries) 6 August 23rd 06 02:29 AM
count each cell that have a number and take that number and count. Vick Excel Discussion (Misc queries) 3 May 19th 06 01:51 AM
All number inputs are divided by 100 ? davor Setting up and Configuration of Excel 2 March 24th 06 01:05 AM
Number count - postcodes and need to count the numbers of tim... Mark - Aust Excel Discussion (Misc queries) 1 October 24th 05 10:00 AM
Count number of times a specific number is displayed in a cell ran subs Excel Worksheet Functions 1 June 27th 05 05:01 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"