View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.newusers
Ron Coderre
 
Posts: n/a
Default Important addition: [Ctrl]+[Shift]+[Enter]

For
E2: =AVERAGE(IF(--($A$2:$A$7=C2)*($A$2:$A$7<=D2),$B$2:$B$7))

You need to commit that array formula by holding down the [Ctrl] and [Shift]
keys when you press [Enter].

***********
Regards,
Ron


"Ron Coderre" wrote:

Try this:
If your data is in Cells A1:B7

C1: From
D1: Thru
E1: AvgCost
C2: 0
D2: 10

C3: 11
D3: 60

C4: 61
D4: 1000

E2: =AVERAGE(IF(--($A$2:$A$7=C2)*($A$2:$A$7<=D2),$B$2:$B$7))
Copy that formula down

Is that what you're looking for?

***********
Regards,
Ron


"Sterling" wrote:


I know just enough in Excel that I know I can get the info I want but
not enough to know how to do it. Any help would be much appreciated. I
am working with 2 columns of data, for example:

Days in Stock____________Cost

2_____________________$300
21____________________$400
117___________________$600
8_____________________$400
37____________________$500
78____________________$500

What I want to calculate is the average cost for 0-10 days in stock
(($300 + $400)/2= $350), the average cost for 11-60 days in stock, and
the average cost for 60+ days in stock.

What sort of formula would best calculate this? TIA.


--
Sterling
------------------------------------------------------------------------
Sterling's Profile: http://www.excelforum.com/member.php...o&userid=29554
View this thread: http://www.excelforum.com/showthread...hreadid=492585