# Indirectly Determine Operation (multiplication, addition, subtraction, etc.)

1. ## Indirectly Determine Operation (multiplication, addition, subtraction, etc.)

Hello,

Is there a good way to determine the operation I want to perform in a formula by another cell. Something like the INDIRECT() function, but this doesn't work for my purpose.

As an example (if INDIRECT worked):

B1 = INDIRECT(5&A1&5)

If A1 = *, B1 would be 25
If A1 = +, B1 would be 10
If A1 = /, B1 would be 1

...etc

Thanks!  Register To Reply

2. ## Re: Indirectly Determine Operation (multiplication, addition, subtraction, etc.)

Hi cazeek1. Welcome to the forum.

Try resurrecting an old Excel 4.0 function called EVALUATE. It still works in newer Excel versions.

You can read here how to implement and apply it.

Edit
Another thought. You might try something like this as well. It doesn't read a text string directly and doesn't require building a concatenated string.

With operators in column A as below:

 A B C 1 * 25 In B1: =CHOOSE(MATCH(A1,{"*","+","/"},0),5*5,5+5,5/5) 2 + 10 3 / 1  Register To Reply

3. ## Re: Indirectly Determine Operation (multiplication, addition, subtraction, etc.)

Dave- thank you very much for the reply. I totally forgot I posted here about this and put that project on hold. Will revisit this later!  Register To Reply

4. ## Re: Indirectly Determine Operation (multiplication, addition, subtraction, etc.)

And another 5 months later, finally came back to this. The CHOOSE() method works perfectly- thank so much!  Register To Reply

5. ## Re: Indirectly Determine Operation (multiplication, addition, subtraction, etc.)

You are welcome. Glad to help. Thank you for the feedback. If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.  Register To Reply

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1