+ Reply to Thread
Results 1 to 4 of 4

Summing brackets, when you have multiple brackets per cell

Hybrid View

  1. #1
    Registered User
    Join Date
    06-26-2017
    Location
    AR
    MS-Off Ver
    2013
    Posts
    2

    Summing brackets, when you have multiple brackets per cell

    Hey all,

    I have a table of data that looks something like:

    [ Part Number ] [Quantity] [ (2) 101 (3) 111 (4) 181 ]
    [ Part Number ] [Quantity] [ (100) 199 (29) 111 ]

    What I need to do is find the summation of each cell's numbers in parenthesis...
    I've tried a method I found on here, but it only returns the value of the FIRST parenthesis per cell, when I need a sum of all.

    Thank you so much for any help and guidance, love this forum so far.
    TM

  2. #2
    Forum Contributor
    Join Date
    03-22-2017
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    230

    Re: Summing brackets, when you have multiple brackets per cell

    Hi TM,

    First,
    I does not fully understand what you want to achieve.

    hence, it is better to put a simple excel file that contain before and after, the most simple way to understand.

    Second, I guess what you want to achieve is split a cell to several cell, [ (2) 101 (3) 111 (4) 181 ] >> [(2)],[101],[(3)],....
    then sum it all.

    if this is you want, I only can suggest a long way,
    highlight the column that need to split,
    Go to Data Ribbon > text to column > choose delimited > check Space > Finish

    then put in the sum formula.
    Hope you can learn every time you visit here.

    If you still confuse on how it work, kindly ask or go to
    i) Formula - Formula (Ribbon) > Formula Auditing (Section) > Evaluate Formula > Evaluate; or
    ii) VBA/Code - Click F8 to see how it work step by step.

    It it take care of your question, Please:
    Mark tread as [Solved] [Thread Tools->Mark thread as Solved]
    ;and
    Click *Add Reputation to thank anyone solved your question.

  3. #3
    Registered User
    Join Date
    06-26-2017
    Location
    AR
    MS-Off Ver
    2013
    Posts
    2

    Re: Summing brackets, when you have multiple brackets per cell

    aaaaaa.PNG



    Sorry, I might not have been very clear. This is what my table looks like. I am wanting the value under "Quantity" to be the sum of the numbers in parenthesis under "Orders".

    I've used:

    =IF(ISERROR(MID(A1,FIND("(",A1)+1,(FIND(")",A1))-(FIND("(",A1)+1))),0,(MID(A1,FIND("(",A1)+1,(FIND(")",A1))-(FIND("(",A1)+1)))+0)
    But only get the value of the FIRST parenthesis.


    Hope this makes more sense....

    TM

  4. #4
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Summing brackets, when you have multiple brackets per cell

    user defined function
    Function bras(d As String) As Long
    Dim i&, nn&, nk&
    
    Do While nk <= Len(d)
    i = i + 1
        nn = InStr(i, d, "(")
        If nn = 0 Then Exit Function
            nk = InStr(nn + 1, d, ")")
                bras = bras + CLng(Mid(d, nn + 1, nk - nn - 1))
                i = nk
    Loop
    End Function

+ 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. Exact text from multiple brackets
    By kenjoo1303 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-25-2016, 08:01 AM
  2. Replies: 13
    Last Post: 08-28-2014, 08:00 PM
  3. [SOLVED] Automating Brackets, and Sum above Brackets in Excel Chart
    By cartica in forum Excel Charting & Pivots
    Replies: 10
    Last Post: 07-24-2014, 11:33 AM
  4. Extracting data from inside multiple brackets
    By crankheart in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-01-2014, 08:02 PM
  5. [SOLVED] Extracting multiple text within brackets
    By guapo in forum Excel General
    Replies: 10
    Last Post: 12-18-2012, 08:19 PM
  6. Replies: 5
    Last Post: 04-19-2012, 09:02 AM
  7. Summing And Joining Numbers In Brackets
    By Lucas75 in forum Excel General
    Replies: 7
    Last Post: 10-13-2011, 07:10 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