+ Reply to Thread
Results 1 to 7 of 7

How do I extract numbers from a single cell and multiply them together?

  1. #1
    Registered User
    Join Date
    01-25-2013
    Location
    new york, usa
    MS-Off Ver
    Excel 2010
    Posts
    4

    How do I extract numbers from a single cell and multiply them together?

    Hi,

    I have a single cell that contains the following character string: 1-3-5-7-9-11

    Is it possible to create a formula to multiply the numeric values together? (1x3x5x7x9x11 = 10,395)

    Thanks!!

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How do I extract numbers from a single cell and multiply them together?

    Maybe something like this

    Enter in B1:

    =LEFT(A1,FIND("-",A1)-1)

    then in C1:

    =IFERROR(SUM(TRIM(MID(SUBSTITUTE("-"&$A1,"-",REPT(" ",50)),50*COLUMNS($A:A),50)))*B1,"")

    and pull formula to the right. The last value will be the result.


    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    1
    1-3-5-7-9-11
    1
    1
    3
    15
    105
    945
    10395
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Registered User
    Join Date
    01-25-2013
    Location
    new york, usa
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: How do I extract numbers from a single cell and multiply them together?

    Thank you!! That was way more complex than I expected.

    Is there a way to keep the function confined to one cell?

    I'm able, for example, to multiply the value of three numbers within a single cell (i.e. 1-7-23) using the formula below. The trouble for me is adding additional numbers beyond 3.

    A1 Cell content: '1-7-23
    =PRODUCT(LEFT(A1,1)*MID(A1,3,1+IF(MID(A1,4,1)="-",0,1))*RIGHT(A1,2))

    Answer: 161

    Thoughts?
    Last edited by dsannito; 10-21-2015 at 02:19 PM.

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How do I extract numbers from a single cell and multiply them together?

    There is another way

    assuming your text values in A1 on Sheet1

    Go to Formulas, Name Manager and enter this formula

    =EVALUATE(SUBSTITUTE(Sheet1!A1,"-","*"))

    Name it MText

    Close Name Manager and enter formula in B1

    =MText

    Save your workbook as Macro-Enabled.

  5. #5
    Registered User
    Join Date
    01-25-2013
    Location
    new york, usa
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: How do I extract numbers from a single cell and multiply them together?

    Thank you so much! This worked perfectly!!!!!

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How do I extract numbers from a single cell and multiply them together?

    You're welcome. Please don't forget to thank those who helped by clicking on Add Reputation * and please mark thread as "Solved" if your issue has been resolved. (Selecting Thread Tools-> Mark thread as Solved).

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How do I extract numbers from a single cell and multiply them together?

    As an afterthought this array formula seems to work:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.

    Row\Col
    A
    B
    C
    1
    1-3-115-7-9-113
    2456055
    In B1 {=PRODUCT(IFERROR(--TRIM(MID(SUBSTITUTE(A1,"-",REPT(" ",20)),(COLUMN(A:Z)-1)*20+1,20)),1))}
    Dave

+ 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. Extract numbers from two cell range into a single cell.
    By Len Farneth in forum Excel General
    Replies: 5
    Last Post: 01-24-2015, 08:53 PM
  2. Replies: 11
    Last Post: 06-27-2014, 08:11 AM
  3. [SOLVED] Extract just numbers from the cell and multiply them
    By subbby in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-15-2014, 04:22 PM
  4. [SOLVED] Extract single cell data based on a single cell entry
    By farmerdoode in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-05-2013, 11:11 PM
  5. [SOLVED] GetMatch plus VBA Code to Extract Matched Numbers from 2 Single Cells
    By david gonzalez in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 02-18-2013, 05:08 PM
  6. [SOLVED] Pull 2 Numbers From Cell Then Multiply Them
    By icschenholm in forum Excel General
    Replies: 3
    Last Post: 07-18-2012, 03:51 PM
  7. Multiply a range of numbers by a cell ?
    By Table10sHotShot in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-26-2006, 04:05 PM

Tags for this Thread

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