# Offset Function Question

#### MikeL

##### Active Member
Hello,
I am using Offset for the first time. I would like the formula to sum cells E2:G2 for a total of "116"

It seems I misunderstand the formula as it moves 2 cells to the left of the G2 and returns "1"

Excel 2007
BCDEFGH
1janfebmaraprmayjune
25104110015
3
4
51
Sheet1
Cell Formulas
RangeFormula
H5=OFFSET(G2,0,-2)

### Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hello,
I am using Offset for the first time. I would like the formula to sum cells E2:G2 for a total of "116"

It seems I misunderstand the formula as it moves 2 cells to the left of the G2 and returns "1"

Excel 2007
BCDEFGH
1janfebmaraprmayjune
25104110015
3
4
51

</tbody>
Sheet1

Worksheet Formulas
CellFormula
H5=OFFSET(G2,0,-2)

</tbody>

<tbody>
</tbody>

You are asking for the value that is 2 columns to the left of the column of G2.

Try...

=SUM(OFFSET(G2,0,0,1,-3))

That worked. Thanks!

Am following up on this...

Why is the optional last value a negative? Per MS support, it has to be positive.

http://support.microsoft.com/kb/324991

Enter the following formulas into cell E2 (or any available blank cell):

=OFFSET(C2,2,-1,1,1)
C2 - The referenced cell.
2 - Indicates the number of rows to move. Positive numbers mean move down, and negative numbers mean move up.
-1 - Indicates the number of columns to move. Positive numbers mean move to the right, and negative numbers mean move to the left.
1 (second last value) - (Optional.) Indicates how many rows of data to return. This number must be a positive number.
1 (last value) - (Optional.) Indicates how many columns of data to return. This number must be a positive number.

Am following up on this...

Why is the optional last value a negative? Per MS support, it has to be positive.

http://support.microsoft.com/kb/324991

Enter the following formulas into cell E2 (or any available blank cell):

=OFFSET(C2,2,-1,1,1)
C2 - The referenced cell.
2 - Indicates the number of rows to move. Positive numbers mean move down, and negative numbers mean move up.
-1 - Indicates the number of columns to move. Positive numbers mean move to the right, and negative numbers mean move to the left.
1 (second last value) - (Optional.) Indicates how many rows of data to return. This number must be a positive number.
1 (last value) - (Optional.) Indicates how many columns of data to return. This number must be a positive number.

If you take E2 as the start address and you intend to sum E2:G2, the formula with OFFSET would look like:

=SUM(OFFSET(E2,0,0,1,3))

If you take G2 as the address to start with and you want still to sum E2:G2, the formla becomes:

=SUM(OFFSET(G2,0,0,1,-3))

where -3 means: sum from 3 cells to the left of G2 (including G2) up to G2.

Replies
8
Views
119
Replies
2
Views
120
Replies
3
Views
158
Replies
4
Views
213
Replies
1
Views
438

1,206,711
Messages
6,074,470
Members
446,071
Latest member
gaborfreeman

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back