View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default count the # of entries when sum matches the target

why the INDEX call?

That is kind of superfluous, isn't it?

Biff

"Harlan Grove" wrote in message
oups.com...
Biff wrote...
Assume your values are in the range A1:F1

In A2 enter this formula:

=SUM($A1:A1)

Copy across to F2

A5 = target value = 450

=INDEX(COLUMN(A2:F2),MATCH(A5,A2:F2,0))

...

No ancillary cells needed. Also, why the INDEX call? Would the MATCH
call return 4? Indeed, move (*cut* & paste) A1:F1 into AA1:AF1. Then
what does your formula return?

Anyway, one single cell alternative would be the array formula

=MATCH(A5,MMULT(A1:F1,--(COLUMN(A1:F1)=TRANSPOSE(COLUMN(A1:F1)))),0)