Highlighted
Visitor

# Function for summing corresponding rows

Hello, I'm trying to find a function that can sum up two numbers if their row number matches. For example, if Column A and Column B are my data sets, then I want a general function f(A_n, B_n) = A_n + B_n whose results will pop up in Column C. I'm aware that you can do a sum and then drag the AutoFill function over the sets I have. But, my Columns A and B are extremely long so dragging AutoFill presents a nuisance. Hoping someone can help me define a function with Excel's Formula feature or maybe using tables. Any assistance appreciated.

Included a picture of an example excel sheet to help visualize.

4 Replies
Highlighted

# Re: Function for summing corresponding rows

Write this formula in cell C1 and fill down:

``=IF(SUM(A1+B1)=0, "", SUM(A1+B1))``

• You may adjust cell references in the formula as needed.
Highlighted

# Re: Function for summing corresponding rows

Ensure your fill handle option is enabled (File/Options/Advanced/Enable fill handle and cell drag and drop).

Enter =A1+B1 in cell C1.

Then, hover the cursor over the bottom right of cell C1 (over the little black square). When the cursor turns to a black cross, double click.

# Re: Function for summing corresponding rows

In you case what @JMB17 suggested is most effective. Just in case, if formula is not in adjacent column, e.g. in column F, enter formula in F1, in Name Box (under top left of the sheet grid) type the reference on the range to be filled (e.g. F1:F999999), Enter (range will be selected), Ctrl+D (formula will be filled into the range).

If to fill horizontally, i.e. the row, same or similar but with Ctrl+R

Highlighted

# Re: Function for summing corresponding rows

Just to throw out one other option for the op in that scenario, I normally select a cell in the column containing the existing data (say column B). Then, hit Ctrl+Down Arrow to get to the bottom row of the range. Then go over to the column I want to fill and input something (anything) in the cell in the column I want to fill. Then ctrl+up arrow, input the formula, copy, ctrl+shift+down arrow, and enter (paste).