Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Problem w/Array Formula

I use an Array formula that provides an average of a range of numbers in a
column. On a spreadsheet similar to the following:
A B C D E
1 Name Type Size Rate Cd
2 Shenan Eff 120 600 E
3 Shenan 2Bd 300 750 B
4 Willow 2Bd 320 900 B
5 Willow 3Bd 450 1,450 C
a formula like {=AVERAGE(IF((B2:B5="2B")*(E2:E5="C"),D2:D5))} produces
#DIV/0!. I need a formula that will will result in an empty value ("")
should the result be #DIV/0!. Any idea's are greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Problem w/Array Formula

Hi!

Try one of these: (both are array formulas)

The pedantic method:

=IF(ISERROR(AVERAGE(IF((B2:B5="2B")*(E2:E5="C"),D2 :D5))),"",AVERAGE(IF((B2:B5="2B")*(E2:E5="C"),D2:D 5)))

Another option that's a few keystrokes shorter:

=IF(SUMPRODUCT(--(B2:B5="2B"),--(E2:E5="C")),AVERAGE(IF((B2:B5="2B")*(E2:E5="C"),D 2:D5)),"")

Biff

"danw" wrote in message
...
I use an Array formula that provides an average of a range of numbers in a
column. On a spreadsheet similar to the following:
A B C D E
1 Name Type Size Rate Cd
2 Shenan Eff 120 600 E
3 Shenan 2Bd 300 750 B
4 Willow 2Bd 320 900 B
5 Willow 3Bd 450 1,450 C
a formula like {=AVERAGE(IF((B2:B5="2B")*(E2:E5="C"),D2:D5))} produces
#DIV/0!. I need a formula that will will result in an empty value ("")
should the result be #DIV/0!. Any idea's are greatly appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 733
Default Problem w/Array Formula

danw wrote...
I use an Array formula that provides an average of a range of numbers in a
column. On a spreadsheet similar to the following:
A B C D E
1 Name Type Size Rate Cd
2 Shenan Eff 120 600 E
3 Shenan 2Bd 300 750 B
4 Willow 2Bd 320 900 B
5 Willow 3Bd 450 1,450 C
a formula like {=AVERAGE(IF((B2:B5="2B")*(E2:E5="C"),D2:D5))} produces
#DIV/0!. I need a formula that will will result in an empty value ("")
should the result be #DIV/0!. Any idea's are greatly appreciated.


Note that there are no "2B" values in the col B sample values above. Do
you mean to match your col B against "2B" as an exact match or as a
substring match? If the latter, make the first conditional term

(LEFT(B2:B5,2)="2B")

For a general approach that only traps #DIV/0! caused by no matching
records, try

=IF(SUMPRODUCT((B2:B5="2B")*(E2:E5="C")),
AVERAGE(IF((B2:B5="2B")*(E2:E5="C"),D2:D5)),"")

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
formula percentage problem thinkpic New Users to Excel 4 November 2nd 05 08:04 PM
formula problem Bart New Users to Excel 4 October 21st 05 12:56 PM
problem with Array Formula OrdOff Excel Worksheet Functions 2 June 30th 05 04:57 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 07:48 PM
Baffling formula problem Ken Schmidt Excel Discussion (Misc queries) 2 December 21st 04 07:52 AM


All times are GMT +1. The time now is 03:28 AM.

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"