Excel count minimum required to reach total of consecutive cells

时间:2017-04-10 00:11:26

标签: excel sum offset

I have a set of data (see below) with a formula that tells me the minimum number of consecutive entries required to sum to a total:

Date        Deliveries   FORMULA
2/11/1998   132.75       47
3/11/1998   170.65       46
4/11/1998   439.55       45
5/11/1998   457.85       45
6/11/1998   337.75       44
9/11/1998   760.2        43
10/11/1998  544.75       42
11/11/1998  28.1         41
12/11/1998  27.95        40
13/11/1998  124.25       39
16/11/1998  826.2        38
17/11/1998  1350.15      37
18/11/1998  1624.3       37
19/11/1998  2076.9       37

Please note the data in column A and B continue for another 200 + Rows.

The formula in C5 is:

  =MATCH($D$3,SUBTOTAL(9,OFFSET(B5,,,ROW(B5:B262)-ROW(B5))),1)

I drag this down in col C and find the minimum which is 37 - basically the minimum number of deliveries to reach my total in D3.

What I want to know is how can I make this so I don't have to drag the formula down, Ie the result is 37 and confirmed by a single entry rather than finding the minimum of Col C.

Cheers!

0 个答案:

没有答案