#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 128
Default If average

I am trying to figure out a formula for excel to look at two columns and
average the data in one of them if a certain number is in column A.

Example: I want Excel to look at the contents in column A for a range of
cells and if the content is the number 1, I want it to then average the
contents of what is in column D for all rows that have a 1 in column A.

I have tried using IF and average and I just get a return of #value. I
tried =average(if(a1:a20="1",d1:d20)) but it returns the error even when I
enter it as an array formula.

Any help is appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default If average

Dear Kris

Your formula is correct. 2 points

1. Check for Text "1" or numeric 1

2. Please note that this is an array formula. Within the cell in edit mode
(F2) paste this formula and press Ctrl+Shift+Enter to apply this formula. If
successful in 'Formula Bar' you can notice the curly braces at both ends like
"{=<formula}"

=AVERAGE(IF(A1:A20=1,D1:D20))

3. Alternatively if you are using 2007 you can use
=AVERAGEIF(A1:A20,1,D1:D20)


If this post helps click Yes
---------------
Jacob Skaria


"Kris" wrote:

I am trying to figure out a formula for excel to look at two columns and
average the data in one of them if a certain number is in column A.

Example: I want Excel to look at the contents in column A for a range of
cells and if the content is the number 1, I want it to then average the
contents of what is in column D for all rows that have a 1 in column A.

I have tried using IF and average and I just get a return of #value. I
tried =average(if(a1:a20="1",d1:d20)) but it returns the error even when I
enter it as an array formula.

Any help is appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 128
Default If average

Thank you, it worked this time, don't know what I was doing wrong, but I got
my averages!

"Jacob Skaria" wrote:

Dear Kris

Your formula is correct. 2 points

1. Check for Text "1" or numeric 1

2. Please note that this is an array formula. Within the cell in edit mode
(F2) paste this formula and press Ctrl+Shift+Enter to apply this formula. If
successful in 'Formula Bar' you can notice the curly braces at both ends like
"{=<formula}"

=AVERAGE(IF(A1:A20=1,D1:D20))

3. Alternatively if you are using 2007 you can use
=AVERAGEIF(A1:A20,1,D1:D20)


If this post helps click Yes
---------------
Jacob Skaria


"Kris" wrote:

I am trying to figure out a formula for excel to look at two columns and
average the data in one of them if a certain number is in column A.

Example: I want Excel to look at the contents in column A for a range of
cells and if the content is the number 1, I want it to then average the
contents of what is in column D for all rows that have a 1 in column A.

I have tried using IF and average and I just get a return of #value. I
tried =average(if(a1:a20="1",d1:d20)) but it returns the error even when I
enter it as an array formula.

Any help is appreciated.

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 07:05 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"