+ Reply to Thread
Results 1 to 5 of 5

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

  1. #1
    Registered User
    Join Date
    06-20-2018
    Location
    New Jersey
    MS-Off Ver
    365
    Posts
    6

    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!

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365, rarely 2007
    Posts
    12,753

    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
    Last edited by FlameRetired; 06-28-2018 at 09:46 PM.
    Dave

  3. #3
    Registered User
    Join Date
    06-20-2018
    Location
    New Jersey
    MS-Off Ver
    365
    Posts
    6

    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!

  4. #4
    Registered User
    Join Date
    06-20-2018
    Location
    New Jersey
    MS-Off Ver
    365
    Posts
    6

    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!

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365, rarely 2007
    Posts
    12,753

    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Addition and subtraction from cell
    By cybershot in forum Excel General
    Replies: 5
    Last Post: 01-01-2016, 07:49 PM
  2. Progressive / continuous subtraction or addition
    By hailcard5130 in forum Excel General
    Replies: 1
    Last Post: 03-08-2015, 04:52 AM
  3. countif with addition or subtraction
    By ammartino44 in forum Excel General
    Replies: 1
    Last Post: 09-30-2014, 06:55 PM
  4. I need help setting up multiplication and Addition!
    By MikeJ1962 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-17-2013, 12:36 PM
  5. Multiplication/addition function
    By Trixie in forum Excel General
    Replies: 4
    Last Post: 01-27-2009, 03:26 PM
  6. Subtraction, division, multiplication of ranges
    By MaritaD in forum Excel General
    Replies: 2
    Last Post: 10-28-2006, 04:42 AM
  7. Error in Addition and Subtraction
    By stat721 in forum Excel General
    Replies: 2
    Last Post: 08-09-2005, 07:05 PM

Bookmarks

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