+ Reply to Thread
Results 1 to 3 of 3

Perform calculations from text strings

  1. #1
    Registered User
    Join Date
    01-13-2022
    Location
    Motta di Livenza, Italy
    MS-Off Ver
    Excel 2016
    Posts
    25

    Perform calculations from text strings

    Hello there,

    I'm writing about the workbook attached. Basically this what it consists on, there are 3 columns:

    - Column A & C: random numbers, either integers or decimals

    - Column B: ADD/SUBTRACT

    Therefore, I would need to get the result of the calculation in Column D, depending on whether Column B is set as "ADD" or "SUBTRACT". Is there a way to do this?

    Thanks a lot in advance for your help!
    Attached Files Attached Files

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,767

    Re: Perform calculations from text strings

    how about
    =IF(B2="ADD",A2+C2,IF(B2="Subtract",A2-C2,""))
    copy down

    was not sure which way the subtraction should occur - A-C or C-A - so just change around to match your requirement
    Attached Files Attached Files
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,528

    Re: Perform calculations from text strings

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. Replies: 1
    Last Post: 04-26-2018, 10:06 AM
  2. Replies: 2
    Last Post: 10-01-2017, 05:21 AM
  3. Using VBA to perform wildcard filter for text strings contained in a list
    By DaveBre in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-01-2014, 10:49 PM
  4. [SOLVED] Perform calculations for multiple rows based on specific column text
    By justinmirsky in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 03-31-2013, 08:20 PM
  5. VBA Help: Perform Calculations Between Cells with VBA
    By Jambo11 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-21-2011, 09:01 AM
  6. Is it possible to perform calculations within vlookup?
    By greyscale in forum Excel General
    Replies: 4
    Last Post: 07-05-2010, 10:44 PM
  7. How does Excel perform is calculations?
    By nils.soderstrom in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2010, 05:45 AM

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