+ Reply to Thread
Results 1 to 6 of 6

Search for Text within a Range of String, Return IQR of Corresponding Cells

  1. #1
    Registered User
    Join Date
    03-07-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Search for Text within a Range of String, Return IQR of Corresponding Cells

    I have been struggling with this formula. I am trying to search for a certain string of text inside a database of larger strings of text, and each time the string is present inside the larger string, I want to put a number corresponding to the text string into the array, and then return the interquartile range of all numbers inside the array.

    Simple example:

    Assume I am searching for "a:"

    sdsasds | 10
    fsdss | 24
    sawead | 20
    ssssss | 28
    sddsass | 30
    asadaa | 40
    jjjjjjj | 23
    jaaa | 50

    The array would include: 10, 20, 30, 40, and 50, and the inter-quartile range would be 40-20 = 20.

    I can piece together parts of the answer:
    Please Login or Register  to view this content.
    This would return the interquartile range. It searches Row I and then uses Row B for purposes of forming the array. The problem is that the cells in Column I must be exactly "r" as opposed to merely containing "r."

    Please Login or Register  to view this content.
    This returns instances of "r" inside any string, but the array attempt does not really work.

    I was able to use the following as part of another function:
    Please Login or Register  to view this content.
    Thanks for any and all help!
    Last edited by jrm0523; 03-08-2012 at 01:51 AM.

  2. #2
    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 for Text within a Range of String, Return IQR of Corresponding Cells

    This array formula, confirmed with CTRL-SHIFT-ENTER...

    =PERCENTILE(IF(ISNUMBER(SEARCH("r", I$2:I$15)), B$2:B$15,""), 0.75) - PERCENTILE(IF(ISNUMBER(SEARCH("r", I$2:I$15)), B$2:B$15, ""), 0.25)
    _________________
    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!)

  3. #3
    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 for Text within a Range of String, Return IQR of Corresponding Cells

    Thanks for the feedback.

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  4. #4
    Registered User
    Join Date
    03-07-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Search for Text within a Range of String, Return IQR of Corresponding Cells

    Is "r" the same as "*r*"?

    To be clear, I want a search for "r" within "dddrddd" to suggest that "r" is present.

    And thank you very much for your help!

  5. #5
    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 for Text within a Range of String, Return IQR of Corresponding Cells

    Read up on the SEARCH() function (F1 in Excel). It finds a string inside another string. So no need to do "*r*".... "r" is enough to search. But you tried it by now, right?

    Please reread post #3.

  6. #6
    Registered User
    Join Date
    03-07-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Search for Text within a Range of String, Return IQR of Corresponding Cells

    For some reason "r" was returning #NUM (possibly a different error). I have no idea why. "*r*" worked. I just wanted to follow-up with that and see your response before noting that it was solved. Thanks for your help.
    Last edited by jrm0523; 03-08-2012 at 01:53 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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