Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 45
Default average-if-and formula

{=AVERAGE(IF(AND(B2:B13241=1,D2:D13241=2),N2:N1324 1,""))}

why doesn't this formula work? thanx!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default average-if-and formula

one way

=SUMPRODUCT((B2:B13241=1)*(D2:D13241=2)*(N2:N13241 ))/SUMPRODUCT((B2:B13241=1)*(D2:D13241=2)*(N2:N13241< 0))


Mike

"Knox" wrote:

{=AVERAGE(IF(AND(B2:B13241=1,D2:D13241=2),N2:N1324 1,""))}

why doesn't this formula work? thanx!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default average-if-and formula

Use this. Array enter.
=AVERAGE(IF((B2:B22=1)*(D2:D22=2),N2:N22))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Knox" wrote in message
...
{=AVERAGE(IF(AND(B2:B13241=1,D2:D13241=2),N2:N1324 1,""))}

why doesn't this formula work? thanx!


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 364
Default average-if-and formula

"Knox" wrote in message
...
{=AVERAGE(IF(AND(B2:B13241=1,D2:D13241=2),N2:N1324 1,""))}

why doesn't this formula work? thanx!


Because you can't use AND with arrays (as it returns only a single result,
not an array). Instead you need to multiply the two arrays:
{=AVERAGE(IF((B2:B13=1)*(D2:D13=2),N2:N13,""))}


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default average-if-and formula

"Knox" wrote:
{=AVERAGE(IF(AND(B2:B13241=1,D2:D13241=2),N2:N1324 1,""))}


You could also try it slightly amended like this, array-entered with CSE*:
=AVERAGE(IF((B2:B13241=1)*(D2:D13241=2),N2:N13241) )

*CSE = Press CTRL+SHIFT+ENTER to confirm the formula
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 45
Default average-if-and formula

Thank you all!

"Stephen" wrote:

"Knox" wrote in message
...
{=AVERAGE(IF(AND(B2:B13241=1,D2:D13241=2),N2:N1324 1,""))}

why doesn't this formula work? thanx!


Because you can't use AND with arrays (as it returns only a single result,
not an array). Instead you need to multiply the two arrays:
{=AVERAGE(IF((B2:B13=1)*(D2:D13=2),N2:N13,""))}



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
Average Formula sross002 Excel Discussion (Misc queries) 6 February 14th 10 06:20 PM
Average Formula wannabe68 Excel Discussion (Misc queries) 2 August 28th 07 12:31 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
#N/A In Max min Average Formula P Beardshall Excel Worksheet Functions 2 November 3rd 04 02:49 PM
Average Formula Vinaya Excel Worksheet Functions 1 October 29th 04 01:53 PM


All times are GMT +1. The time now is 02:33 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"