Combining the contents of a range of cells into one cell, as a formula.

Wayne Burman

New Member
Joined
Jan 4, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi,

Is it possible to combine the number contents of a range of cells into one cell, but as a formula containing each number?

For example, if I have three adjacent cells with the following numbers in them: 3, 4 & 5.
I want to combine them into another cell, so that the new cell's contents are =3+4+5.
The new cell will show the answer of that formula, i.e. 12, but when I edit the cell, I can see the individual numbers that make up the sum.

Thanks very much,
Wayne
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Welcome to the Board!

Let's say that your range is A1:C1 and you want to put the formula in cell D1.
Then you could run a short VBA procedure like this to do that:
VBA Code:
Sub CreateFormula()
    Range("D1").Formula = "=" & Range("A1").Value & "+" & Range("B1").Value & "+" & Range("C1").Value
End Sub
 
Upvote 0
Just be aware that this resulting formula will not actually be linked to those input cells like a normal formula.
That is, if the value in cell A1 is altered, neither the formula nor value in cell D1 will change.
 
Upvote 0
Just be aware that this resulting formula will not actually be linked to those input cells like a normal formula.
That is, if the value in cell A1 is altered, neither the formula nor value in cell D1 will change.
Oh, okay, thanks for the heads up. The values shouldn't change, so should be okay.
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,930
Members
449,094
Latest member
teemeren

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