+ Reply to Thread
Results 1 to 10 of 10

Formula on text string extractoin

  1. #1
    Registered User
    Join Date
    10-04-2022
    Location
    london, canada
    MS-Off Ver
    cloud version, MS Office subscription
    Posts
    10

    Formula on text string extractoin

    Hello,

    I want to sum two cells that extract the text string between two characters, "(" and ")" in adjacent cells. It appears that the SUM function will only return zero as a result because the results in the two cells in question are derived from extracting the text from adjacent cells rather than numbers I have directly imputed.

    Is there a way to make the SUM function work properly on cells such as these?
    Attached Images Attached Images

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,164

    Re: Formula on text string extractoin

    Try adding +0 to the end of the formula in both D3 & D4

  3. #3
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,474

    Re: Formula on text string extractoin

    use =VALUE() around your entire formula in D3 and D4 and then you can sum
    <----- If you are happy with your solution please click on the "* Add Reputation" as a way to say thank you.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Formula on text string extractoin

    Providing your small sample is representative and you don't have more than a few thousand rows... try:

    =SUM(FILTERXML("<A><B>"&SUBSTITUTE(SUBSTITUTE(A2:A3,"$","</B><B>"),")","")&"</B></A>","//B[2]"))

    Refer to the file. If the formulae are enclosed within a pair of { }, these are array formulae.

    These are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see the curly brackets { } appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Formula on text string extractoin

    or... if these functions are available in your Excel version:

    =SUM(--TEXTBEFORE(TEXTAFTER(A2:A3,"$"),")"))

  6. #6
    Registered User
    Join Date
    10-04-2022
    Location
    london, canada
    MS-Off Ver
    cloud version, MS Office subscription
    Posts
    10

    Re: Formula on text string extractoin

    Thanks Fluff13. I went with yours since it was the first on the list . It worked fine.

    Thanks also dosydos and Glenn Kennedy

    Much appreciated

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Formula on text string extractoin

    You said "I went with yours since it was the first on the list". as good a reason as any!!

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please click on "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,164

    Re: Formula on text string extractoin

    Glad to help & thanks for the feedback.

  9. #9
    Registered User
    Join Date
    10-04-2022
    Location
    london, canada
    MS-Off Ver
    cloud version, MS Office subscription
    Posts
    10

    Re: Formula on text string extractoin

    Sure thing!

  10. #10
    Registered User
    Join Date
    10-04-2022
    Location
    london, canada
    MS-Off Ver
    cloud version, MS Office subscription
    Posts
    10

    Re: Formula on text string extractoin

    Could you please show me how to mark this as "solved"? I just searched the page and none of the [CTRL]F hits were fruitful.

+ 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: 2
    Last Post: 05-27-2016, 12:30 AM
  2. Replies: 2
    Last Post: 11-18-2014, 06:26 AM
  3. Formula to find and return text string within a cell full of text strings
    By LightingPop in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-03-2013, 11:45 PM
  4. [SOLVED] Extract text from a string of text (amend formula to include new criteria)
    By robertguy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-10-2013, 04:53 PM
  5. [SOLVED] Find partial text string within another text string return original text into cell.
    By mikey42979 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-17-2013, 02:58 PM
  6. [SOLVED] Highlight a portion of string text (the string text is a value of a formula)
    By RaymondH in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-02-2012, 06:50 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