# How to give range to find the sum

#### Dili1234

##### New Member
I'm doing a statistics workbook there I need to add untill the given value in the cell
ex: if gave 5 in the cell we want to get the total until only to 5th cells
 (M/M/S)FIFS/INF/N) No of Server 3 l 0.20 n Coeffient P nP m 0.4 0 1 0.060657 0 P(0) 0.060657 q 0.5 1 2.5 0.151643 0.151643 Ls 2.245156 2 5 0.303286 0.606571 N 5 3 7.5 0.454928 1.364785 4 0.416666667 0.025274 0.101095 5 0.069444444 0.004212 0.021061

<colgroup><col><col span="3"><col><col span="6"></colgroup><tbody>
</tbody>
We changing the value in N=5

### Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

#### Dili1234

##### New Member
Could you help me little more ................
I couldn't get it.

#### Misca

##### Well-known Member
The OFFSET function does not return a value but a range that you want to use in your actual calculations.

The syntax is

=OFFSET(starting point, rows to move, columns to move, height, width)

Where:
Starting point is the base range (= usually a single cell). This is the anchor point of your OFFSET function.
The Rows / Columns to move set how many rows / columns you want to move from the starting point before the actual range begins: OFFSET(B2,-1,1) means the OFFSET-range moves one row up and one column to the right from B2 (=C1).
The height and width set the actual size of your range: OFFSET(B2,-1,1,5,2) means you want your range to be 5 rows tall and 2 columns wide, starting 1 row up and one column right from B2. The formula returns the range C1:D5.

=SUM(
OFFSET(B2,-1,1,5,2)) means you want to SUM the values in your OFFSET range. The static formula for the same thing would be SUM(C1:D5).

Often times you replace the static rows / columns / heights / widths with formulas returning the desired value (for example COUNT to return how many rows of data there is or MATCH to find a certain value from your list).

#### Dili1234

##### New Member
Thank you very much....................

#### Dili1234

##### New Member
How to get the content of a cell to offset function.because in my problem range is determine by N
if N=5 then I have to get the sum of 5 rows and if N=3 then I have to get the sum of 3 rows like wise it goes on...........

#### Peter_SSs

##### MrExcel MVP, Moderator
How to get the content of a cell to offset function.because in my problem range is determine by N
if N=5 then I have to get the sum of 5 rows and if N=3 then I have to get the sum of 3 rows like wise it goes on...........
I can't really see what you are trying to do in post #1, but to sum N rows of a range, you can do as follows. Hopefully you can then apply that to your actual problem, or describe your problem more clearly.

As suggested by Misca, this is also possible by using OFFSET but that is a volatile function so I would avoid that when there are feasible non-volatile alternatives like below.

Excel Workbook
ABCD
1DataNSUM
214
10
32
43
54
65
76
87
9
10
SUM N rows

#### Dili1234

##### New Member
Thank you.............very much to both of you