Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 229
Default What is the math behind array function

Hello everybody
How an array function calculates? for ex
{sum(1/(countif(range, criteria)} returns the number of non-repeats
I tried to analyse it in the following way, but of no use
CIF ARRY-CIF 1/CIF ARRAY-1/CIF SUM-CIF ARAY-SUMCIF SUM-1/CIF ARAY-1/SUMCIF
Cow 2 2.00 0.50 0.50 2.00 17.00 0.50 3.00
cat 2 2.00 0.50 0.50 2.00 17.00 0.50 3.00
mat 3 2.00 0.33 0.50 3.00 17.00 0.33 3.00
cow 2 2.00 0.50 0.50 2.00 17.00 0.50 3.00
cat 2 2.00 0.50 0.50 2.00 17.00 0.50 3.00
mat 3 2.00 0.33 0.50 3.00 17.00 0.33 3.00
mat 3 2.00 0.33 0.50 3.00 17.00 0.33 3.00

CIF COUNTIF($A$2:$A$8,$A$2:$A$8)
SUM-CIF SUM(COUNTIF($A$2:$A$8,$A$2:$A$8))
Thanks to all
regards
Sridhar
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 364
Default What is the math behind array function

"yshridhar" wrote in message
...
Hello everybody
How an array function calculates? for ex
{sum(1/(countif(range, criteria)} returns the number of non-repeats
I tried to analyse it in the following way, but of no use
CIF ARRY-CIF 1/CIF ARRAY-1/CIF SUM-CIF ARAY-SUMCIF SUM-1/CIF ARAY-1/SUMCIF
Cow 2 2.00 0.50 0.50 2.00 17.00 0.50 3.00
cat 2 2.00 0.50 0.50 2.00 17.00 0.50 3.00
mat 3 2.00 0.33 0.50 3.00 17.00 0.33 3.00
cow 2 2.00 0.50 0.50 2.00 17.00 0.50 3.00
cat 2 2.00 0.50 0.50 2.00 17.00 0.50 3.00
mat 3 2.00 0.33 0.50 3.00 17.00 0.33 3.00
mat 3 2.00 0.33 0.50 3.00 17.00 0.33 3.00

CIF COUNTIF($A$2:$A$8,$A$2:$A$8)
SUM-CIF SUM(COUNTIF($A$2:$A$8,$A$2:$A$8))
Thanks to all
regards
Sridhar


It's often a good idea to work with a small array and simple data to get the
idea, for example
=SUM(1/COUNTIF(A1:A5,A1:A5))
(array-entered)
with the data dog,cat,cat,dog,dog in A1:A5.

In any formula, you can highlight part of it in the formula bar and press F9
to show the result of that part of the formula.
For example, highlight COUNTIF(A1:A5,A1:A5) and press F9 and you will see
the resulting array {3;2;2;3;3} highlighted in the overall expression
=SUM(1/{3;2;2;3;3}).
(Press ESC to get out of this mode. Pressing ENTER would replace the
function by the result in the formula!)

Now it's easy to see what this is doing. It will sum 1/3, 1/2, 1/2, 1/3, 1/3
to give the result of 2.
Each data value that occurs 3 times adds 1/3 into the result; each data
value that occurs 2 times adds 1/2 into the result.
In general, each data value that occurs n times adds 1/n into the result.
Hence a total of 1 is added into the result for each different data value,
giving a count of the number of unique data values.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 229
Default What is the math behind array function

Thank you Stephen. It is nice to follow the calculation of a function by
highligting and F9. I don't know about this option. I will try to the other
functions also.
Thanks alot
Regards
Sridhar

"Stephen" wrote:

"yshridhar" wrote in message
...
Hello everybody
How an array function calculates? for ex
{sum(1/(countif(range, criteria)} returns the number of non-repeats
I tried to analyse it in the following way, but of no use
CIF ARRY-CIF 1/CIF ARRAY-1/CIF SUM-CIF ARAY-SUMCIF SUM-1/CIF ARAY-1/SUMCIF
Cow 2 2.00 0.50 0.50 2.00 17.00 0.50 3.00
cat 2 2.00 0.50 0.50 2.00 17.00 0.50 3.00
mat 3 2.00 0.33 0.50 3.00 17.00 0.33 3.00
cow 2 2.00 0.50 0.50 2.00 17.00 0.50 3.00
cat 2 2.00 0.50 0.50 2.00 17.00 0.50 3.00
mat 3 2.00 0.33 0.50 3.00 17.00 0.33 3.00
mat 3 2.00 0.33 0.50 3.00 17.00 0.33 3.00

CIF COUNTIF($A$2:$A$8,$A$2:$A$8)
SUM-CIF SUM(COUNTIF($A$2:$A$8,$A$2:$A$8))
Thanks to all
regards
Sridhar


It's often a good idea to work with a small array and simple data to get the
idea, for example
=SUM(1/COUNTIF(A1:A5,A1:A5))
(array-entered)
with the data dog,cat,cat,dog,dog in A1:A5.

In any formula, you can highlight part of it in the formula bar and press F9
to show the result of that part of the formula.
For example, highlight COUNTIF(A1:A5,A1:A5) and press F9 and you will see
the resulting array {3;2;2;3;3} highlighted in the overall expression
=SUM(1/{3;2;2;3;3}).
(Press ESC to get out of this mode. Pressing ENTER would replace the
function by the result in the formula!)

Now it's easy to see what this is doing. It will sum 1/3, 1/2, 1/2, 1/3, 1/3
to give the result of 2.
Each data value that occurs 3 times adds 1/3 into the result; each data
value that occurs 2 times adds 1/2 into the result.
In general, each data value that occurs n times adds 1/n into the result.
Hence a total of 1 is added into the result for each different data value,
giving a count of the number of unique data values.



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
Matrix Math using LOOKUP inside Array {} Function ExcelMonkey Excel Worksheet Functions 4 February 15th 07 11:10 PM
any function good for statistics or math please been dribbled to 2007 Excel Worksheet Functions 0 January 1st 07 10:50 PM
Math Function Curtis Excel Discussion (Misc queries) 2 July 28th 06 04:24 AM
efficiency: database functions vs. math functions vs. array formula nickname Excel Discussion (Misc queries) 2 July 14th 06 04:26 AM
Need help with math Function wytedragn Excel Worksheet Functions 2 June 29th 06 10:51 PM


All times are GMT +1. The time now is 11:33 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"