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

Hi!

Use a helper row:

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))

Biff

wrote in message
oups.com...
Dear all,

How to count the number of integers when sum of those, calculated from
left to right, meets a predefined target

E.g:
Range: 50, 100, 200, 100, 150, 300
Target: 450
Function should return 4

Thanks!