Here's the approach I would take:
1. Get the text for the formula.
2. Break it up into a list of tokens (numbers, symbols). Regular expressions can be used here or scanning over the text a character at a time, tokenat isn't suitable. Error checking is done here as well to look for invalid syntax.
3. Convert the token list from infix notation (1 + 1) to reverse polish notation (1 1 +) as in that form it's simple to evaluate.
There are other ways out there as the topic is pretty vast. You'll end up writing a lot of events (or code) to get something working well.