+ Reply to Thread
Results 1 to 7 of 7

Multiply String "x" and number

  1. #1
    Forum Contributor
    Join Date
    12-20-2019
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    116

    Multiply String "x" and number

    A2 12x12x12
    A3 12X13X12
    A4 12X18X21

    I want to multiply it, the character X is creating issue.
    How can I multiply these?

  2. #2
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,655

    Re: Multiply String "x" and number

    Please Login or Register  to view this content.
    Maybe this?
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  3. #3
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: Multiply String "x" and number

    Popipipo's solution would work fine if all cells contained three two-digit numbers separated by x's. If that's not the case, it will likely be easier to use VBA, specifically the Evaluate function. The good news is that using this method you can also do addition, subtraction and division (assuming you use the +, - and / characters). You could even convert this to a function to use as a formula in your spreadsheet rather than having to run a macro anytime your column A values change.
    Please Login or Register  to view this content.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,330

    Re: Multiply String "x" and number

    Hi diy,

    I saw this YouTube video a few weeks ago that gave me a hint for this magic answer at:
    https://www.bing.com/videos/search?q...5&&FORM=VDRVRV

    What it showed is that you can use the VBA "Evaluate" function in the Names Manager.
    In the Names Manager I used "=EVALUATE(SUBSTITUTE(Sheet1!A2,"x","*"))" when in B2.
    Now in B3 simply type "=Eval" and boom the answer appears. Magic??

    See the attached
    Evaluate in Named Range.xlsm
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Multiply String "x" and number

    You could also use...

    Please Login or Register  to view this content.
    Then in B2 >> =nSum(A2)
    HTH
    Regards, Jeff

  6. #6
    Forum Contributor
    Join Date
    12-20-2019
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    116

    Re: Multiply String "x" and number

    Yes, you are right Paul.
    Last edited by diyVBA; 05-06-2020 at 12:14 PM.

  7. #7
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: Multiply String "x" and number

    Wrong thread, diyVBA? This is an older one of yours that doesn't seem to relate.

+ 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. [SOLVED] Macro to extract specific number from string starts with "18"
    By rajuuuuu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-06-2018, 08:21 AM
  2. Replies: 6
    Last Post: 11-27-2016, 09:53 AM
  3. [SOLVED] Count number of rows in a range that contain less than 5 cells with the string "VAC"
    By bananius in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-25-2014, 03:58 PM
  4. Replies: 1
    Last Post: 08-15-2014, 06:00 AM
  5. Replies: 0
    Last Post: 03-21-2014, 09:58 AM
  6. Replies: 2
    Last Post: 10-10-2013, 11:09 AM
  7. [SOLVED] How to Count number of "Error" and "OK" after the word "Instrument" found in table row
    By eltonlaw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2012, 06:26 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