?
Solved

How to use offset in horizontal sum

Posted on 2014-01-17
5
Medium Priority
?
329 Views
Last Modified: 2014-02-01
I have a spread sheet where I am summing the values horizontally by setting cell AC 21 to
=SUM(A21,D21,G21,J21,M21,P21,S21) .  I am
When I add a new line, I want to be able to copy the formula down - in effect setting cell
AC22 to =SUM(A22,D22,G22,J22,M22,P22,S22)

I have used the offset method when I wanted to sum cell values vertically
=SUM(A8:OFFSET(A23,-1,0)), however I'm not sure how to do it horizontally, particularly when the cells to be added are not contiquous
0
Comment
Question by:chtullu135
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39788992
A simple copy from ac21 to ac22 should do this. Why do you want to use offset?
0
 

Author Comment

by:chtullu135
ID: 39789022
I am adding the row via code.  It is a timesheet application where the date are along a horizontal access and where users can make multiple entries for a date.  There is a button on the form that allows user to add a new line to the timesheet.  However, the new row has to be summed horizontally. I think I am probably being confused by my previous use of offset to vertical summing when new rows are being added.  I think what I need to do is copy the formula via vba to the new line.  The user does not want to have to copy the formula down himself
0
 

Author Comment

by:chtullu135
ID: 39789061
I figured it out, I used a copy and paste via vba to insert the formula into the new line
0
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 2000 total points
ID: 39790208
A better approach is to use RC type addresses. So it would be something like


.formular1c1 = "=sum(rc1,rc4,rc7,rc10,rc13,rc16,rc19)"
0
 

Author Closing Comment

by:chtullu135
ID: 39826941
I apologize for the delay.  Thanks for the tip on using the RC type addresses
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question