Excel sum numbers from just one cell problem

Copper Contributor

Hello.
In one cell, I have something like this: 1*5+30
I want some other cell to display sum of the content in that cell. =SUM(A2) does not work. How to do that?

2 Replies

@ensarhamzic 

 

You wrote: In one cell, I have something like this: 1*5+30
I want some other cell to display sum of the content in that cell. =SUM(A2) does not work. How to do that?

 

So may I ask you what the answer should be? What are you expecting as the "sum of the content in that cell"?

  • 36? (1+5+30, a sum of the numbers, but ignoring the non-numerics)
  • 35? (multiplying 1 times 5 and then adding 30)
  • 35? (adding 5+30 and then multiplying by 1)....in this instance, because of the 1 as the multiplier, the last two are the same, but that would not be true if you had begun with, say, a 2

 

In any event, why don't you have cell A2, which presumably is where you figures appear, written as

=1*5+30

If you did, you'd be getting the result right there (35). As it is, by entering it without the preceding equals sign, you're de facto treating it as text.

 

So let's see if we can get a little background here. WHY are you entering that first string of characters, some of which happen to be numbers, in that fashion? There are ways to handle this, but before we get to that, there may also be a much better way to get to the desired result.

  • So (for example) are you a teacher wanting to write down a problem for students to solve, and therefore wanting to enter it in cell A2 as you have done it?
  • Will you be entering other "problems" in that fashion, and then wanting to test results by a formula elsewhere, maybe right adjacent, on the sheet?
  • In short, what's this a part of?

 

@ensarhamzic 

Not sure what exactly do you mean, as variant you may use named formula as

image.png

the only the file shall be saved as macro-enabled.