|
|
|
|
|
|
|
| |
=sum(offset(A1,0,0,5,1)) will sum the five cells starting in A1 and going
down through five cells. You could use a cell reference rather than 5:
=sum(offset(a1,0,0,b1,1))
"William" wrote:
> So this is what I was wondering on how to do:
>
> I have a set of numbers, and I want to sum them, BUT I don't always want to
> sum all of them. The amount to sum is specified thru another cell, and I am
> always summing the numbers in order. Ex. if I type in a cell "5", it'll sum
> the first 5 numbers, but if i type in 10, it'll sum the first 10 numbers. So
> basically, the numnbers to sum are dependent on the number you input in the
> one cell. I tried looking at SUMIF, but that only returns the sum if the
> corresponding row of another column meets a criteria. The criteria for my
> case is in the one cell. What equation do I use? |
| |
|
| |
Was this post helpful to you? |
|
|
|
|
|
|
|
Reply |
| |
 |
|
Top |
|
|
|
|
|
|
|
| |
Answer |
|
| |
One way
=SUM(A1:INDEX(A1:A100,B1))
where you would put the number of rows you want to sum in B1, note that it
will sum the whole range if nothing is entered in B1 so if you don't want
that
=IF(B1="","",SUM(A1:INDEX(A1:A100,B1)))
--
Regards,
Peo Sjoblom
"William" <William@discussions.microsoft.com> wrote in message
news:F1293BF1-1552-45F6-B9D2-F3784040467A@microsoft.com...
> So this is what I was wondering on how to do:
>
> I have a set of numbers, and I want to sum them, BUT I don't always want
> to
> sum all of them. The amount to sum is specified thru another cell, and I
> am
> always summing the numbers in order. Ex. if I type in a cell "5", it'll
> sum
> the first 5 numbers, but if i type in 10, it'll sum the first 10 numbers.
> So
> basically, the numnbers to sum are dependent on the number you input in
> the
> one cell. I tried looking at SUMIF, but that only returns the sum if the
> corresponding row of another column meets a criteria. The criteria for my
> case is in the one cell. What equation do I use?
|
| |
|
| |
Was this post helpful to you? |
|
|
|
|
|
|
|
Reply |
| |
 |
|
Top |
|
|
|
|
|
|
|
|
|
| |
Hi!
Try this:
The range of numbers is A1:A10. There can be no empty cells within the
range. B1 is the cell where you enter the number of cells to sum.
=SUM(A1:INDEX(A1:A10,B1))
Will there always be a number of cells that is at least equal to the number
selected? For example, you only 5 numbers in the range but the number
entered in cell B1 is 10?
Biff
"William" <William@discussions.microsoft.com> wrote in message
news:F1293BF1-1552-45F6-B9D2-F3784040467A@microsoft.com...
> So this is what I was wondering on how to do:
>
> I have a set of numbers, and I want to sum them, BUT I don't always want
> to
> sum all of them. The amount to sum is specified thru another cell, and I
> am
> always summing the numbers in order. Ex. if I type in a cell "5", it'll
> sum
> the first 5 numbers, but if i type in 10, it'll sum the first 10 numbers.
> So
> basically, the numnbers to sum are dependent on the number you input in
> the
> one cell. I tried looking at SUMIF, but that only returns the sum if the
> corresponding row of another column meets a criteria. The criteria for my
> case is in the one cell. What equation do I use?
|
| |
|
| |
Was this post helpful to you? |
|
|
|
|
|
|
|
Reply |
| |
 |
|
Top |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|