Count number of values until exceeding a figure

  • Thread starter Thread starter tunupo
  • Start date Start date
T

tunupo

Hello,

I have a table that looks like this:

----------------------------
A B C D E
1. 8
2. 6 3 4 3 2
3. Output: 3
---------------------------

The output value should show the number of columns (starting from E2
going to the left) it takes to add until the value (of the figures in
row E) is higher than E1.

In this case that would be 2 + 3 + 4 > 8, therefore the output would
be 3.
If E1 is 13, then the output would be 5, etc.

This formula is used to calculate the number of months of expenses to
replace an inventory figure.

Thanks for your time.
 
Hi tunupo,

One way;

Put this formula in cell E3
=SUM(E2:$E2)>$E$1

Copy it to D3:A3

In cell E4 enter
=COUNTIF(A3:E3,FALSE)+1

Does that do what you want?

Ed Ferrero
www.edferrero.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top