Multiplying Contiguous Values in an Array

B

bgetson

Given a 15 day period, where each row represents a day, I want to find
the maximum value within a row's respective time-period when all
contiguous values are multiplied together.

If sample data looks a little something like this, where column "A"
has a day #, "B" is each value, and "C" is where this prospective
function would go, column C should list the maximum product of all
contiguous values within the last 15 days. For day 2-11, (2*3) is the
greatest value. But by day 17, the value 5 is the largest.

(day) (value) (max)
A B C
1 2 2
2 3 6
3 6
4 6
5 5 6
6 6
7 1 6
8 2 6
9 2 6
10 6
11 6
.......
17 5

I hope this makes sense, and any help would be appreciated.
-bgetson
 
L

Leo Heuser

Given a 15 day period, where each row represents a day, I want to find
the maximum value within a row's respective time-period when all
contiguous values are multiplied together.

If sample data looks a little something like this, where column "A"
has a day #, "B" is each value, and "C" is where this prospective
function would go, column C should list the maximum product of all
contiguous values within the last 15 days. For day 2-11, (2*3) is the
greatest value. But by day 17, the value 5 is the largest.

(day) (value) (max)
A B C
1 2 2
2 3 6
3 6
4 6
5 5 6
6 6
7 1 6
8 2 6
9 2 6
10 6
11 6
......
17 5

I hope this makes sense, and any help would be appreciated.
-bgetson

-bgetson

It's not entirely clear to me, what you're trying to accomplish.
Perhaps this can be of help:

1. In C1 enter the formula =B1
2. In C2 the formula =MAX(B2*B1,C1)
3. Copy C2 down with the fill handle (the little square in the
lower right corner of the cell)
 

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

Top