Sum of cells where the same cell contains both text and a formula

Coastie

New Member
Joined
May 25, 2002
Messages
23
I have retired and now use google sheets instead of excel, so I hope that's not the cardinal sin of MrExcel.

I am trying to add cells that have a text label and a value, Example.

Code:
Cell A1 = 2
Cell A2 = 4
Cell A3 = 6
Cell A4 = 8

Cell B2 = ="One  "&text(A1+A2, 0)
Cell B3 = ="Two  "&text(A2+A3, 0)
Cell B4 = ="Three "&text(A3+A4, 0)

Cells B2-B4 work fine, but I would like to add those cells together, I was hoping something like this would work, but it does not.
Code:
="Total  "&text(SUM(B2:B4), 0)

1677621321458.png


Looking for a total of 30.
Is there a simple way to do that?
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
that returns a different number, than the above. Also, the B cells, are a different formula in use, I just somehow need to add the results together.
 
Upvote 0
Ah, stupid me

Not sure how it works in Googlesheets but in Excel I would create a helper formula on column C.
Starting on C2, I enter this formula to strip the number from the text:
Excel Formula:
=INT(MID(B2, FIND(" ", B2), 5))

Then total it at the bottom:
Excel Formula:
=SUM(C2:C4)

Not sure if it is doable in one go without a helper formula.
 
Upvote 0
that =int formula does work in googlesheets, though as you guessed, I am indeed trying to do it all in a single cell without a helper if at all possible.
 
Upvote 0
Try this code

Cell A1 = 2
Cell A2 = 4
Cell A3 = 6
Cell A4 = 8

Cell B2 = ="One "&text(A1+A2, 0)
Cell B3 = ="Two "&text(A2+A3, 0)
Cell B4 = ="Three "&text(A3+A4, 0)
Cell B5 = ="Total "&text(SUM(A1:A4)+SUM(A2:A3), 0)
 
Upvote 0
(SUM of 2+4+6+8) = 20) + (Sum of 4+6 = 10) = 30
 
Upvote 0
that won't work because the formulas in the B cells are more complex in use. If possible, I'd need to sum the B cells.
 
Upvote 0
I have retired and now use google sheets instead of excel, so I hope that's not the cardinal sin of MrExcel.
No, asking Google Sheets questions is fine - so long as they are asked in the correct forum, not the Excel Questions forum. So I have moved it for you. ;)

1677640061853.png
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,021
Latest member
pingpong7117

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