Offset Function Question

MikeL

Active Member
Joined
Mar 17, 2002
Messages
488
Office Version
  1. 365
Platform
  1. Windows
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"

Thanks in advance.



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

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
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"

Thanks in advance.


Excel 2007
BCDEFGH
1janfebmaraprmayjune
25104110015
3
4
51

<colgroup><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

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

<thead>
</thead><tbody>
</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))
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,488
Members
448,967
Latest member
visheshkotha

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top