View Single Post
  #10   Report Post  
Harlan Grove
 
Posts: n/a
Default

Bob Phillips wrote...
Where in the OP does it suggest that an array is required, and what is

the
point?

....
Bob Phillips wrote...

....
=AVERAGE(IF(OR(LEFT(A2:A640,2)="TU"),(LEFT(A2:A 640,5)="ANA36")),B2:B640)

array entered.


How about a short example. A2:B7 containing

TU#### 1
ANA36@ 2
FOOBAR 3
TU 4
ANA44 5
ANA36 6

The *array* formula

=AVERAGE(IF(OR(LEFT(A2:A7,2)="TU"),(LEFT(A2:A7,5)= "ANA36")),B2:B7)

returns 3.5, which is the average of *ALL* numbers in B2:B7. Your
formula when array-entered returns the average of *ALL* numbers in
B2:B7 no matter what's in A2:A7. On the other hand, Peo's array formula

=AVERAGE(IF((LEFT(A2:A7,2)="TU")+(LEFT(A2:A7,5)="A NA36"),B2:B7))

returns 3.25. If you enter 1s in C2, C3, C5 and C7, the array formula

=AVERAGE(IF(C2:C7,B2:B7))

also returns 3.25.

Anyway, I misread your formula. I thought the B2:B640 reference was
inside the IF call. It isn't. All your IF(OR(..),..) call does is
return an array of booleans to the AVERAGE function, which then ignores
them. Is that what you intended?