+ Reply to Thread
Results 1 to 4 of 4

Looking for an arry function to return cells containing a text string

  1. #1
    Registered User
    Join Date
    04-03-2017
    Location
    New York, NY
    MS-Off Ver
    2013
    Posts
    3

    Looking for an arry function to return cells containing a text string

    I work in a scheduling department we build all our schedules into an Excel grid for our employees. In order to more easily search for all the people working a given shift on a particular day, I created the following array function..
    {=SMALL(IF($C$1:$C$200=E$2,ROW($C$1:$C$200)),ROW(1:1))}

    From there, I use an Index function to pull up the names corresponding to all the rows, which has been working well. Unfortunately, the way people's shifts have been entered are no longer uniform. So rather than looking for individual values, I was hoping to use a search for a text string in a similar fashion, to return matching values and then using an index to match up names. I tried this, but Excel isn't giving me much help to step through the calculations..
    =small(if(isnumber(search(k$30,$c$1:$c$200))),row($c$1:$c$200),row(1:1))

    Any suggesting on how to make this work? Thanks

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Looking for an arry function to return cells containing a text string

    Hi, welcome to the forum

    Hard to work blind on something like this, I suggest that you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Looking for an arry function to return cells containing a text string

    Not sure, but try:

    =small(if(isnumber(search(k$30,$c$1:$c$200)),row($c$1:$c$200),""),row(1:1))
    Quang PT

  4. #4
    Registered User
    Join Date
    04-03-2017
    Location
    New York, NY
    MS-Off Ver
    2013
    Posts
    3

    Re: Looking for an arry function to return cells containing a text string

    That did the trick. Looks like I was missing the value_if_false argument from the IF function, so the "" fixed it. Thanks!!

+ 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. [SOLVED] IF range of cells contains string of text, return contents of cell where string is found
    By nobodyukno in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-03-2013, 09:56 AM
  2. [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
  3. Sub to remove text from string in multiple cells then return in one
    By DadaaP in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-09-2013, 04:04 AM
  4. I need a function that will return a value nested in a text string
    By dgallegos in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-18-2013, 04:06 PM
  5. [SOLVED] INDEX, cells containing text within string, return corresponding values in next column
    By amazingg64 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-05-2012, 08:30 AM
  6. Replies: 1
    Last Post: 05-02-2012, 08:05 AM
  7. Replies: 5
    Last Post: 03-08-2012, 01:50 AM
  8. Find, return string address in a range of cells with numbers and text
    By Vera22 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-09-2007, 08:37 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