Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel "VALUE" Function Applied to Equations 7

Status
Not open for further replies.

cyclotis04

Programmer
Aug 5, 2008
3
Basically, I need something to take "2+3*4" and return '14'. VALUE will take "14", but it doesn't like the operators in the middle; it wants one single number. Is there an easy way to do this?
 
I'm confused.

=2+3*4 will give you 14. Excel processes the multiplication before the addition. I'd think that you were just missing the equals sign, but Value wouldn't work without an equals sign, either.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Hi cyclotis04,

I'm assuming that you want to process a string of "2+3*4", and get an answer. Let's say that this string is in cell A2 ( without the quotes ), then select cell B2 ( where the answer will be ), and do menu commmand Insert/Name/Define, and create a name of Eval_cell_to_left with a definition of
Code:
=EVALUATE(!A2)

Now enter
Code:
=Eval_cell_to_left
into cell B2.

Cheers, Glenn.

Beauty is in the eye of the beerholder.
 
Worth a star for that Glenn - nice!

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thanks Geoff :-D . I always knew that those old Excel macro commands would come in useful one day.

Cheers, Glenn.

Beauty is in the eye of the beerholder.
 

Here here! God save The Queen!

Have some suds on me, Glenn! [cheers]

I assume that the BANG, san sheetname, indicates that it can be used on ANY sheet.

That one's going into the card file, and will, some day, be pulled out of a hat! ;-)

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Is there anyway to do this all in the cell, without creating a name? If not, this definitely works too =]
Thanks!
 




"without creating a name"

You REALLY need to understand and make use of Name Ranges. Is not Eval_cell_to_left more understandable than =EVALUATE(!A2)

For instance, wouldn't it be clearer to have a formula
[tt]
=Miles/Hour
[/tt]
than
[tt]
=A2/B2
[/tt]
???

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Well its never going to work in the cell that you have your text in so will always need to be in a different cell - as Skip says, you may as well use something explanatory than a non explanatory cell ref...

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Hi cyclotis04,

no it can't be done without creating a name, but, as Skip says, you can use names to make formulae much more understandable. I use defined names all the time, whether or not they are "necessary".

Cheers, Glenn.

Beauty is in the eye of the beerholder.
 
Maybe I shouldn't post after midnight.... Not that I would have come up with this solution even if I had understood what was being asked.

Very nicely done, Glenn.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
That's fine, higgins. I looked back at my question and realized it did look awefully cryptic. Thanks for trying to help out, though! Order of opperations is something I have down pretty well, though ;-)
 



"Order of opperations is something I have down pretty well, though"

I'd suggest NEVER leaving it up to the "manager" Use parentheses to make it "perfectly clear", and you'll never get "nixed-on" anything!

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Glenn... one more celestial object from me.

Interesting how some of the old stuff comes in handy. In my new job, DOS commands work much better than working between windows. I guess all those years of DOS is paying off now.

Vita Brevis
 
Thanks xlhelp and TonyJollans,

I sometimes revert to DOS too, for easiness. I guess there's quite a few old fashioned people around.

Cheers, Glenn.

Beauty is in the eye of the beerholder.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top