Use OFFSET to add cells in a row and ending at a specific point

fddekker

Board Regular
Joined
Jun 30, 2008
Messages
86
Office Version
  1. 365
Platform
  1. Windows
I want to add cells, always starting in a particular column, but end at a different column for each row, according to a pre-determined factor.
Offset_zps4c8eaxk0.png.html

Offset_zps4c8eaxk0.png.html


Below is an example:
Offset_zps4c8eaxk0.png.html
http://s1300.photobucket.com/user/fddekker/media/Offset_zps4c8eaxk0.png.html?sort=3&o=0

How can I use the offset function in a formula to determine the last point and not the starting point.
Offset_zps4c8eaxk0.png.html


(Any reason I can't post a photobucket image in the thread?)

Thanks in advance
 
Last edited:

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
You cannot upload files to this site. But there are tools you can use to post screen images. They are listed in Section B of this link here: http://www.mrexcel.com/forum/board-a...forum-use.html.
Also, there is a Test Here forum on this board that you can use to test out these tools to make sure they are working correctly before using them in your question.

 
Upvote 0
Thanks for that. I have not posted in a while and was unaware of the new tools. Note that the link to the video is down.

So here is the example:

Book1
ABCDEFGH
1Heading 1Heading 2Heading 3Heading 4Heading 5OffsetTotal
2Amount 11010101010140
3Amount 21010101010410
4Amount 31010101010230
5Amount 41010101010320
6Amount 51010101010140
Sheet1


I would like to add each row, but the last column should be dynamic, based on the number in column G (in this example). I have tried using the OFFset functionality and the R1C1 reference method, but must be doing something wrong with both.

Thanks!!
 
Upvote 0
So, walk me through this.
Are we adding to the yellow cells or the white cells?
Are we always adding 10 to each cell? If not, how do we determine what we are adding in each cell?
Are we populating and incrementing the value in column A?
Where are we getting the value to Offset by? Is that being input from somewhere?
 
Upvote 0
Joe, sorry I was not clearer:

Are we adding to the yellow cells or the white cells?
We need to add the yellow cells. All the rows will have the same number of entries, but depending on the number entered in column G, the number of columns should be added. So, Column G's entry tells me how many columns NOT to add. The correct totals are in column H.

Are we always adding 10 to each cell? If not, how do we determine what we are adding in each cell?
No, not always 10; It contains data downloaded from another program.

Are we populating and incrementing the value in column A?
No, column A was just my description. It could be anything. But do note that the data will not always start in column B. (I want to do the same addition on several sheets, and the blocks of data is not always in the same columns)

Where are we getting the value to Offset by? Is that being input from somewhere?
The OFFset is calculated according to a formula on another set of data. For this exercise, assume that it is given and will be in a cell towards the right of the data that should be summed.

Hope it helps!


 
Last edited:
Upvote 0
I got it now. I totally misunderstood, and thought you were talking about adding cells or rows and populating them.

Try this formula in H2 and copy down:
Code:
=SUM(B2:OFFSET(B2,0,4-G2))
 
Upvote 0
Solution
You are welcome!
Glad I was able to help.:)
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,643
Members
449,093
Latest member
Ahmad123098

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