Link to home
Start Free TrialLog in
Avatar of chevronrod
chevronrodFlag for United States of America

asked on

convert text formula to its mathematical result

(Apologies if this has been answered. I couldn't find it, though.)

I have this arithmetic expression in TEXT format (for example): 8 + 6 - (-9). This is for a math worksheet. The student is to evaluate it (to 23, in this example). Currently I have to do the math myself and type in the answers (for an answer sheet).

Can I just copy and paste somehow so that Excel will take that TEXT expression and do the math for me and show the result in a cell. Can I do it without macros (functions are o.k.). I want to keep it simple.
Avatar of zorvek (Kevin Jones)
zorvek (Kevin Jones)
Flag of United States of America image

The quickest way is to copy the text to another cell, type an equal sign, and paste the equation.

Do you need a more automated solution?

Kevin
ASKER CERTIFIED SOLUTION
Avatar of zorvek (Kevin Jones)
zorvek (Kevin Jones)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
A few small caveats with Brad's solution: You see an equal sign in the printed equation, the formatting can get a little dicey as Excel expands the column widths by a percentage when showing formula view, and ALL formulas on the sheet will be displayed, even those you that you DON'T what to be displayed as formulas.

Kevin
HainKurt,
I'd have sworn that the user-defined function in that freevbcode.com link wasn't going to work in a worksheet formula--but I would have been wrong. It may be slow and inefficient to launch a new instance of Excel to evaluate the formula in a single cell, but it does work in Excel 2003.

Brad
But, seriously, why would you want to fire up an Excel instance to run a function that you can run in the parent instance without any adverse affects?
Avatar of chevronrod

ASKER

Awarded it to both. The function is a good idea and I like it a lot. But my company locks out any macros on Excel sheets. I might be able to get an exception for the one I'm making.

The ~ solution is a great time saver as well (especially in the meantime).

So I've awarded both experts on this one.