Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default averageif for a range of values in another column

I need to take the average of colum A for the cells that have either a 1 or a
2 in the corresponding rows of column B. How do I do this?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,073
Default averageif for a range of values in another column

On Apr 26, 9:21*am, -ken wrote:
I need to take the average of colum A for the cells that have either a 1 or a
2 in the corresponding rows of column B. How do I do this?


One way, for first 100 rows...

=SUMPRODUCT(A1:A100,--((B1:B100=2)+(B1:B100=1)))/SUMPRODUCT(--
((B1:B100=2)+(B1:B100=1)))

Ken Johnson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default averageif for a range of values in another column

Try this array formula** :

=AVERAGE(IF(B1:B20={1,2},A1:A20))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP


"-ken" wrote in message
...
I need to take the average of colum A for the cells that have either a 1 or
a
2 in the corresponding rows of column B. How do I do this?



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
Help with Averageif Formula (don't think I should use Averageif) MUmfleet Excel Discussion (Misc queries) 5 April 9th 09 04:53 PM
search from range in column 1 and print from corresponding values manu Excel Discussion (Misc queries) 1 October 23rd 08 06:05 AM
Adding Date Range to Averageif statement lwilliams Excel Discussion (Misc queries) 2 October 3rd 08 02:59 PM
Counting a specific range of values within a column kenm Excel Discussion (Misc queries) 7 January 2nd 07 08:34 PM
Can you average data in 1 column based on a range of values in another? kman24 Excel Worksheet Functions 2 November 17th 04 02:09 PM


All times are GMT +1. The time now is 10:32 PM.

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"