ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add columns horizontally? A1+B1; A2+B2 (https://www.excelbanter.com/excel-programming/382560-add-columns-horizontally-a1-b1%3B-a2-b2.html)

FredVC

Add columns horizontally? A1+B1; A2+B2
 
I have found nothing that tells me how to a simple addition of the individual
items in one column with another column. That is, I want to add A1 & B1; A2
& B2, etc. Or any other math function. I have 169 data items in each
column, and need to do multiple math functions on the items, which are all
related horizontally. Excel Help is helpless as far as I can tell--offering
no clear guidance for what seems to me a very simple programming step.
Surely there is a way. FC

Tom Ogilvy

Add columns horizontally? A1+B1; A2+B2
 
It isn't clear this is what you want, but for your consideration:

Sub Tester1()
Dim rng as Range, cell as Range
set rng = Range(Cells(1,1),Cells(1,1).End(xldown))
for each cell in rng
cell.offset(0,2).Value = Cell.Value + cell.offset(0,1).value
Next
End Sub

--
Regards,
Tom Ogilvy

"FredVC" wrote in message
...
I have found nothing that tells me how to a simple addition of the
individual
items in one column with another column. That is, I want to add A1 & B1;
A2
& B2, etc. Or any other math function. I have 169 data items in each
column, and need to do multiple math functions on the items, which are all
related horizontally. Excel Help is helpless as far as I can
tell--offering
no clear guidance for what seems to me a very simple programming step.
Surely there is a way. FC




Gary''s Student

Add columns horizontally? A1+B1; A2+B2
 
The mathematical manipulations you desire to perform are instrumented in
Excel as "equations" or "formulae"

You have data in columns A and B and wish to view the sums pair-wise. First
you must select the column in which you wish the sums to appear. Let's pick
column C.

In cell C1 enter the following:
=A1+B1
Then select cell C1, copy it and then paste into cells C2 thru C169.
--
Gary's Student
gsnu200703


"FredVC" wrote:

I have found nothing that tells me how to a simple addition of the individual
items in one column with another column. That is, I want to add A1 & B1; A2
& B2, etc. Or any other math function. I have 169 data items in each
column, and need to do multiple math functions on the items, which are all
related horizontally. Excel Help is helpless as far as I can tell--offering
no clear guidance for what seems to me a very simple programming step.
Surely there is a way. FC


JLGWhiz

Add columns horizontally? A1+B1; A2+B2
 
More information can be found in VBA help under the specific operators of +,
-, *, / and the comparison operator =.

"FredVC" wrote:

I have found nothing that tells me how to a simple addition of the individual
items in one column with another column. That is, I want to add A1 & B1; A2
& B2, etc. Or any other math function. I have 169 data items in each
column, and need to do multiple math functions on the items, which are all
related horizontally. Excel Help is helpless as far as I can tell--offering
no clear guidance for what seems to me a very simple programming step.
Surely there is a way. FC



All times are GMT +1. The time now is 02:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com