#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Average if

Hi. Is there a way to do an average if? Basically, if the contents of
column A is "Y", then include the contents on column B in the average?
Thanks!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Average if

HI Steph,

Isn't this a SUMIF divided by a COUNTIF?

Ric

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Average if

=IF(A1:A100="Y",B1:B100)

this is an array formula, so commit with Ctrl-Shift-Enter. It also means
that you cannot use a whole column, just a specific range.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Steph" wrote in message
...
Hi. Is there a way to do an average if? Basically, if the contents of
column A is "Y", then include the contents on column B in the average?
Thanks!




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Average if

Thanks Bob, but I can't get it to work. It looks like the formula only
takes into account the first record in the array. Am I doing something
wrong? Thanks!

"Bob Phillips" wrote in message
...
=IF(A1:A100="Y",B1:B100)

this is an array formula, so commit with Ctrl-Shift-Enter. It also means
that you cannot use a whole column, just a specific range.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Steph" wrote in message
...
Hi. Is there a way to do an average if? Basically, if the contents of
column A is "Y", then include the contents on column B in the average?
Thanks!






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Average if

Steph,

Use the following array formula. Change the ranges to suit your
needs.

=AVERAGE(IF(A1:A10="Y",B1:B10,FALSE))

Since this is an array formula, you must press Ctrl+Shift+Enter
rather than just Enter when you first enter the formula and
whenever you edit it later. If you do this properly, Excel will
display the formula enclosed it curly braces {}.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Steph" wrote in message
...
Thanks Bob, but I can't get it to work. It looks like the
formula only
takes into account the first record in the array. Am I doing
something
wrong? Thanks!

"Bob Phillips" wrote in
message
...
=IF(A1:A100="Y",B1:B100)

this is an array formula, so commit with Ctrl-Shift-Enter. It
also means
that you cannot use a whole column, just a specific range.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Steph" wrote in message
...
Hi. Is there a way to do an average if? Basically, if the
contents of
column A is "Y", then include the contents on column B in
the average?
Thanks!










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Average if

Oops, sorry I forgot the AVERAGE

=AVERAGE(IF(A1:A100="Y",B1:B100))

still an array formula.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Steph" wrote in message
...
Thanks Bob, but I can't get it to work. It looks like the formula only
takes into account the first record in the array. Am I doing something
wrong? Thanks!

"Bob Phillips" wrote in message
...
=IF(A1:A100="Y",B1:B100)

this is an array formula, so commit with Ctrl-Shift-Enter. It also means
that you cannot use a whole column, just a specific range.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Steph" wrote in message
...
Hi. Is there a way to do an average if? Basically, if the contents

of
column A is "Y", then include the contents on column B in the average?
Thanks!








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
A formula to AVERAGE IF but only average a set number of values [email protected] Excel Worksheet Functions 2 January 31st 08 08:28 PM
Find monthly average but have average automatically configured kimbafred Excel Discussion (Misc queries) 2 August 8th 07 12:28 AM
Error Handling #N/A with AVERAGE Function - Average of values in Row Sam via OfficeKB.com Excel Worksheet Functions 13 July 31st 05 03:59 PM
Weighed Average of a weiged average when there are blanks krl - ExcelForums.com Excel Discussion (Misc queries) 1 July 6th 05 07:37 PM
how does one convert text to a formula "average(A:A)" to =average( phshirk Excel Worksheet Functions 4 April 14th 05 01:20 AM


All times are GMT +1. The time now is 04:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"