<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Chandoo.org - Learn Excel &#38; Charting Online - Forums Topic: Arrays - average corresponding values for each occurance</title>
		<link>http://chandoo.org/forums/topic/arrays-average-corresponding-values-for-each-occurance</link>
		<description>Ask Excel and Charting Questions, Muse about Visualizations, Learn and Share - Discussion Forums - Chandoo.org</description>
		<language>en-US</language>
		<pubDate>Sat, 18 May 2013 10:11:54 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://chandoo.org/forums/search.php</link>
		</textInput>
		<atom:link href="http://chandoo.org/forums/rss/topic/arrays-average-corresponding-values-for-each-occurance" rel="self" type="application/rss+xml" />

		<item>
			<title>Hui on "Arrays - average corresponding values for each occurance"</title>
			<link>http://chandoo.org/forums/topic/arrays-average-corresponding-values-for-each-occurance#post-1094</link>
			<pubDate>Mon, 01 Mar 2010 06:23:21 +0000</pubDate>
			<dc:creator>Hui</dc:creator>
			<guid isPermaLink="false">1094@http://chandoo.org/forums/</guid>
			<description>&#60;p&#62;Katish&#60;/p&#62;
&#60;p&#62;I wrote a simple User Defined Function (UDF) which will do your job for you&#60;/p&#62;
&#60;p&#62;You need to paste the following code into a Code Module&#60;br /&#62;
Alt F11 and click on a Module without the ='s&#60;br /&#62;
======&#60;/p&#62;
&#60;p&#62;Function Summ(Arr_Lst As Range, Arr_Tbl As Range)&#60;br /&#62;
Summ = 0&#60;br /&#62;
For x = LBound(Arr_Lst()) To UBound(Arr_Lst())&#60;br /&#62;
    For y = LBound(Arr_Tbl()) To UBound(Arr_Tbl())&#60;br /&#62;
        If Arr_Lst(x) = Arr_Tbl(y, 1) Then Summ = Summ + Arr_Tbl(y, 2)&#60;br /&#62;
    Next&#60;br /&#62;
Next&#60;br /&#62;
End Function&#60;/p&#62;
&#60;p&#62;=====&#60;/p&#62;
&#60;p&#62;To use the code and assuming the values are in&#60;br /&#62;
A1:A5 - a b c a c&#60;br /&#62;
D1:D3 - a b c&#60;br /&#62;
E1:E3 - 1 5 3&#60;/p&#62;
&#60;p&#62;To get the Sum&#60;/p&#62;
&#60;p&#62;Type in =Summ(A1:A5,D1:E3)&#60;/p&#62;
&#60;p&#62;To get the average  =Summ(A1:A5,D1:E3)/Counta(A1:A5)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>katish on "Arrays - average corresponding values for each occurance"</title>
			<link>http://chandoo.org/forums/topic/arrays-average-corresponding-values-for-each-occurance#post-1084</link>
			<pubDate>Fri, 26 Feb 2010 19:08:29 +0000</pubDate>
			<dc:creator>katish</dc:creator>
			<guid isPermaLink="false">1084@http://chandoo.org/forums/</guid>
			<description>&#60;p&#62;The post came out unligned..&#60;br /&#62;
A1:A5 - a b c a c&#60;br /&#62;
D1:D3 - a b c&#60;br /&#62;
E1:E3 - 1 5 3&#60;/p&#62;
&#60;p&#62;This means: a = 1, b = 5, c = 3&#60;/p&#62;
&#60;p&#62;So I want the resulting array that would be: 1 5 3 1 3 (corresponding values)&#60;br /&#62;
Then I can average these numbers. Is this clear at all? I could upload the actual spreadsheet somewhere...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Hui on "Arrays - average corresponding values for each occurance"</title>
			<link>http://chandoo.org/forums/topic/arrays-average-corresponding-values-for-each-occurance#post-1081</link>
			<pubDate>Fri, 26 Feb 2010 14:24:41 +0000</pubDate>
			<dc:creator>Hui</dc:creator>
			<guid isPermaLink="false">1081@http://chandoo.org/forums/</guid>
			<description>&#60;p&#62;Katish&#60;/p&#62;
&#60;p&#62;From your example what should be in E1, E2 and E3 ?&#60;br /&#62;
How are those values related to D1:D3 and A1:A5 ?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>katish on "Arrays - average corresponding values for each occurance"</title>
			<link>http://chandoo.org/forums/topic/arrays-average-corresponding-values-for-each-occurance#post-1080</link>
			<pubDate>Fri, 26 Feb 2010 13:10:57 +0000</pubDate>
			<dc:creator>katish</dc:creator>
			<guid isPermaLink="false">1080@http://chandoo.org/forums/</guid>
			<description>&#60;p&#62;Hui, thanks for your thought, but I'm not sure how to use the COUNTIF result to retrieve the values in column E? &#60;/p&#62;
&#60;p&#62;Also, I cannot use the 'copy down' part, the whole point is to have a formula in a single cell, otherwise I would have gone with VLOOKUP.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Hui on "Arrays - average corresponding values for each occurance"</title>
			<link>http://chandoo.org/forums/topic/arrays-average-corresponding-values-for-each-occurance#post-1078</link>
			<pubDate>Fri, 26 Feb 2010 06:19:49 +0000</pubDate>
			<dc:creator>Hui</dc:creator>
			<guid isPermaLink="false">1078@http://chandoo.org/forums/</guid>
			<description>&#60;p&#62;Katish&#60;br /&#62;
Do you want to count the values in Column D when they are in column A&#60;br /&#62;
then in E1 put&#60;/p&#62;
&#60;p&#62;=COUNTIF($A$1:$A$5,D1) will count them&#60;br /&#62;
and copy down
&#60;/p&#62;</description>
		</item>
		<item>
			<title>katish on "Arrays - average corresponding values for each occurance"</title>
			<link>http://chandoo.org/forums/topic/arrays-average-corresponding-values-for-each-occurance#post-1075</link>
			<pubDate>Fri, 26 Feb 2010 01:58:40 +0000</pubDate>
			<dc:creator>katish</dc:creator>
			<guid isPermaLink="false">1075@http://chandoo.org/forums/</guid>
			<description>&#60;p&#62;Hi everyone! I hope someone can shed some light, because it's driving me crazy here. Been working on this for over a week now!&#60;/p&#62;
&#60;p&#62;Suppose this situation:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;A  B  C  D  E
1 a        a  1
2 b        b  5
3 c        c  3
4 a
5 c&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;What I need is: get the corresponding values in E for each value of A, and then average it (or sum, or whatever). I thought about (entered as an array formula):&#60;br /&#62;
=AVERAGE(INDIRECT(&#34;E&#34;&#38;amp;MATCH(A1:A5;D1:D3;0)))&#60;/p&#62;
&#60;p&#62;But this doesn't work. It makes no sense to me, because evaluating with F9 shows INDIRECT being parsed right.&#60;/p&#62;
&#60;p&#62;Is there any other way to achieve this? I tried other lookup functions but everything I tried failed, except for CHOOSE. But CHOOSE doesn't seem like an elegant choice of function to achieve this... Plus, my search array already has 112 values, and the limit is 256..&#60;/p&#62;
&#60;p&#62;So, PLEASE, ANY help will be greatly appreciated!&#60;/p&#62;
&#60;p&#62;Much love from Brazil! :)
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
