View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sheeloo[_5_] Sheeloo[_5_] is offline
external usenet poster
 
Posts: 248
Default Sumproduct array

Assumig D1 has country number 1026 this will give you the sum of the values
for 1026
=SUMPRODUCT(--($C$6:$C$214=D1),$C$5:$C$213)
assuming your data is in A1:A101 with country numbers in A1, A4, A6,..A102
and this will give you the count of values for country number 1026
=SUMPRODUCT(--($C$5:$C$213=D1))

You can copy this down wi th other country numbers in D2,D3... and then get
the weighted average based on values in the two columns with the above
formula...

Warning: This will not work if the country number matches any of the values...

-------------------------------------
Pl. click ''''Yes'''' if this was helpful...



"Jumbo Jock" wrote:

Hi there,
I have a vertical data array that begins in cell C5 and ends at cell C214.
Each pair of consecutive lines contains data applicable to a single country
and I need to be able to calculate a global weighted average in cell C215. So
the data array looks like this:-

Country A data 95.4
Country A number 1026
Country B data 101.2
Country B number 504
Country C data 100.9
Country C number 14526
etc
etc

I want to use the sumproduct formula but can't seem to make it work. There
must be a quicker way than creating a formula that multiplies each pair of
lines together and divides the sum by the sum of the "number" lines but I
can't figure it out? Anyone out there help?
Thanks