# RC sum formula references

#### Cullen

##### New Member
I need to sum from a specific point(d14) down a column various lengths depending on a user input. If the user inputs say 5, I need something along the lines of:

ActiveCell.FormulaR1C1 = "=SUM(R14C:R[num]C)"

The 'num' is defined from a userform and could be any number they put in.

### Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

#### VoG

##### Legend
Try

Code:
``ActiveCell.FormulaR1C1 = "=SUM(R14C:R[" & num & "]C)"``

#### Cullen

##### New Member
Thank for your reply. This works from the relative reference of the cell that displays the sum, but I really want to move down 'num' cells from d14, not the cell with the formula. I don't have a clue on the syntax for that. Something like:

ActiveCell.FormulaR1C1 = "=SUM(R14C:R14[-" & num & "]C)"

How do you keep the static reference of R14 in the second half of the range minus the num inputted Thanks!

#### VoG

##### Legend
Is it?

Code:
``ActiveCell.FormulaR1C1 = "=SUM(R14C:R[" & 14 - num & "]C)"``

#### Cullen

##### New Member
Wonderful. I had to tweak it a little bit and create another number range from the cells below what I wanted and subtract them and the 3 blank cells above the cell with the formula. Works perfect. Thank you so much for your help.

ActiveCell.FormulaR1C1 = "=SUM(R14C:R[" & -3 - Enum & "]C)"

Replies
1
Views
192
Replies
3
Views
345
Replies
5
Views
332
Replies
12
Views
1K
Replies
4
Views
247

1,191,045
Messages
5,984,326
Members
439,882
Latest member
gerdc

### 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.

### Which adblocker are you using?

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

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