Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default operating over a range in an array

I have a two column array, let's call the values in these columns X and Y. I
want to perform a function (e.g. average, sum, etc.) on the Y values from a
given approximate starting value of X (i.e. X1) to a given approximate ending
value, X2. I have Excel 2003. I get close to a solution using INDEX and
MATCH, but I can't figure out how to specify the range of cells I want within
the math function. Additionally, the number of Y values between X1 and X2 is
unknown and must be arbitrary.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default operating over a range in an array

SUMPRODUCT is often an appropriate solution.

=SUMPRODUCT(--(A2:A100=X1),--(A2:A100<=X2),B2:B100) would give you the sum.
=SUMPRODUCT(--(A2:A100=X1),--(A2:A100<=X2),B2:B100)/SUMPRODUCT(--(A2:A100=X1),--(A2:A100<=X2))
would give you the average.
--
David Biddulph

"ghengis_na'an" wrote in message
...
I have a two column array, let's call the values in these columns X and Y.
I
want to perform a function (e.g. average, sum, etc.) on the Y values from
a
given approximate starting value of X (i.e. X1) to a given approximate
ending
value, X2. I have Excel 2003. I get close to a solution using INDEX and
MATCH, but I can't figure out how to specify the range of cells I want
within
the math function. Additionally, the number of Y values between X1 and X2
is
unknown and must be arbitrary.



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
Operating baseline before disrtibutions txgold Excel Discussion (Misc queries) 3 August 6th 09 01:54 PM
Highlighting Operating Hours Rebecca R Charts and Charting in Excel 3 August 17th 07 07:23 PM
where is the product code for operating cd jojo Setting up and Configuration of Excel 0 December 25th 05 03:26 PM
How do I calculate operating expense KAE1994 Excel Worksheet Functions 8 August 23rd 05 09:43 PM
Operating on hidden sheets Hari Prasadh Excel Discussion (Misc queries) 2 January 28th 05 08:33 AM


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

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"