If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > average function

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-29-04, 15:53
tjarvas tjarvas is offline
Registered User
 
Join Date: Mar 2004
Posts: 361
average function

I need some help writing an average function. This is what I have right now.

=SUM(Sheet2!$K1:$K25)/COUNTA(Sheet2!$K1:$K25)

I need to have the function validate two other columns.

Ex: if Column a = 2001 and Column b=Dec the aveage the values that corespond in column K.

Any Clue????
Reply With Quote
  #2 (permalink)  
Old 03-30-04, 03:19
DavidCoutts DavidCoutts is offline
Registered User
 
Join Date: Jan 2004
Location: Aberdeen, Scotland
Posts: 1,067
Re: average function

How i Tackled this is to use this Function

=SUMPRODUCT((Sheet2!A1:A25=2001)*(Sheet2!B1:B25="d ec")*(Sheet2!K1:K25))/SUMPRODUCT(((Sheet2!A1:A25=2001)*(Sheet2!B1:B25="d ec")))

the Numerator produces the sum of all the values in K1:K25 where your two conditions apply.

The Denominator counts all the cases where A1:A25 = 2001 and B1:B25 = "dec"

so the average is Sum/Count

Hope this Helps

David
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On