+ Reply to Thread
Results 1 to 11 of 11

Search number between specific text

  1. #1
    Forum Contributor
    Join Date
    05-17-2012
    Location
    CA, USA
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    163

    Search number between specific text

    Hey all,

    A particular cell my contain the following text: "1. Multi-zone VAV AHUs (6) - 101, 102, 105, 111, 112, 117; Points: 30 per unit (DWG: P3 M7.1.3.1)"

    The result I'm looking for is the only parenthesis that contains a number, therefore in this example would be 6. Hope someone can help out with this. Thanks!

    T

  2. #2
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Search number between specific text

    Is it always going to be the case that the parenthesis you want will be the first ones? Or will the formula have to assess all (fixed? variable?) parenthesis pairs?
    Click the [* Add Reputation] Button to thank people for help!
    Post Attachment: Click [Go Advanced] under the reply box; then click [Manage Attachments] to launch the attachments dialogue.
    Mark Thread Solved: Go to the top of the first post; Select [Thread Tools] dropdown; Pick the [Mark thread as Solved] option.

  3. #3
    Forum Contributor
    Join Date
    05-17-2012
    Location
    CA, USA
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    163

    Re: Search number between specific text

    The first set of parenthesis may not always include a number. Another example would be "16. Hydronic Systems (CHW, HHW) - North: (5) AHU 104, 105, FCU 101, 102, MUA-1, South: (6) AHU 106, 111, 112, 115, 117, 119 (DWG: P3 M4.1.1)" where the two numbers would be summed up as 11 (5 and 6).

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Search number between specific text

    This formula will pull out the text between the first ( and ) encountered in the string:

    =MID(A2, SEARCH("(",A2)+1,SEARCH(")",MID(A2, SEARCH("(",A2)+1,100))-1)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Forum Contributor
    Join Date
    05-17-2012
    Location
    CA, USA
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    163

    Re: Search number between specific text

    Hi JBeaucaire, could this be modified to also accomodate the example in post #3? https://www.excelforum.com/excel-for...ml#post4856143

  6. #6
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Search number between specific text

    are all of your numbers between the parens single digits (like the 5 and 6 in your example)?
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  7. #7
    Forum Contributor
    Join Date
    05-17-2012
    Location
    CA, USA
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    163

    Re: Search number between specific text

    Sambo kid, they are strictly numbers but the largest would be triple digits.

  8. #8
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Search number between specific text

    so just to clarify the request, there can be anywhere from one (6) to two (6) and (5) (but not 3 or more of these) and they can be anywhere in length of from 1 to 3 digits each like (54) and (321) and you want all other items in parens which can be alpha and alpha numeric ignored and you want the end product to be the sum if there are two or more of these. Is that correct?

  9. #9
    Forum Contributor
    Join Date
    05-17-2012
    Location
    CA, USA
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    163

    Re: Search number between specific text

    Sambo kid, correct. There can be anywhere from one to two values in parenthesis, i.e. (6) and (5) and can be anywhere in length from 1 to 3 digits such as (5) and (111) and all other alphanumeric text within parenthesis will be ignored. A number-only parenthesis would be summed up with any other number-only parenthesis within the same cell.

  10. #10
    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: Search number between specific text

    Here is an example on how to sum values between parenthesis
    Enter array formula in B1 and copy down

    ***Array formula
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.
    You will know the array is active when you see curly braces { } appear around your formula.
    If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This formula will sum up values between multiple parenthesis
    Unknown
    A
    B
    1
    1. Multi-zone VAV AHUs (6) - 101, (102), (105), 111, (112), (117); Points: 30 per unit (DWG: P3 M7.1.3.1)
    442
    2
    16. Hydronic Systems (CHW, HHW) - North: (5) AHU 104, 105, FCU 101, 102, MUA-1, South: (6) AHU 106, 111, 112, 115, 117, 119 (DWG: P3 M4.1.1)
    11
    Sheet: Sheet1
    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

  11. #11
    Forum Contributor
    Join Date
    05-17-2012
    Location
    CA, USA
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    163

    Re: Search number between specific text

    Thanks AlKey and everyone else! That helped out =)

+ 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: 02-23-2018, 07:04 PM
  2. [SOLVED] Search many workbooks for specific text, then insert a text in adjacent cell
    By MDW12 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-26-2017, 02:08 PM
  3. [SOLVED] Search through columns and find specific text and replace that text with header column
    By adamzee in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-09-2014, 11:59 PM
  4. VBA Code - Search text & search number & search qty and result - Urgent Please
    By naresh73 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2014, 10:51 AM
  5. [SOLVED] search for text, then search for previous text, replace 1st text including number from 2nd
    By kldailey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-06-2012, 05:23 PM
  6. [SOLVED] search for text in colB, starting with next row search for 1st occurrence of specific #
    By roothog in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-24-2012, 10:39 PM
  7. Search for TEXT and assign a specific number
    By Sub7 in forum Excel General
    Replies: 12
    Last Post: 08-28-2010, 03:05 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