+ Reply to Thread
Results 1 to 13 of 13

Use array formula for range using search

  1. #1
    Registered User
    Join Date
    01-25-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    18

    Use array formula for range using search

    I have this formula that uses one search function to do multiple searches.

    The formula is
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    but I'm getting an error message.


    HTML Code: 
    The answer I want is 2 (row 2) since all the matches occur there.

    What is wrong with the formula?

  2. #2
    Registered User
    Join Date
    01-25-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Use array formula for range using search

    All the words in each row are contained in column B.

  3. #3
    Registered User
    Join Date
    01-25-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Use array formula for range using search

    I should have mentioned that I have Excel 2010, with upgrading to Excel 2013 soon.

    Maybe using a "match(true" statement would work but then I wouldn't get multiple matches.

    There doesn't seem to be a way to do this in Excel.

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Use array formula for range using search

    one search to do multiple search...whats the outcome if multiple are found?
    also a sample file would make it easier to test outcomes for you
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  5. #5
    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: Use array formula for range using search

    Maybe something like this

    in B1 and copy down

    =IFERROR(IF(LOOKUP(2^15,SEARCH({"house","tent","zebra"},B1)),ROW()),"")

    Data Range
    B
    C
    1
    dog cat zebra
    1
    2
    zebra house
    2
    3
    car mouse
    4
    box can orange tent
    4
    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

  6. #6
    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,926

    Re: Use array formula for range using search

    AlKey, I think the search needs to find the cell that matches all of them
    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

  7. #7
    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: Use array formula for range using search

    Quote Originally Posted by FDibbins View Post
    AlKey, I think the search needs to find the cell that matches all of them
    I don't think I know exactly what OP wants. but here is something different


    =SUM(COUNTIF(B1,"*"&{"house","tent","zebra"}&"*"))


    Data Range
    B
    C
    1
    dog cat zebra
    1
    2
    zebra house
    2
    3
    car mouse
    0
    4
    box can orange tent
    1

  8. #8
    Registered User
    Join Date
    01-25-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Use array formula for range using search

    Thanks for getting back to me. I would like to keep this part of the formula intact as I can change the search criteria easily.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    As an illustration, If I wanted to change my match to "house" and "zebra" only; I would change =7 to =5 (1 and 4 added)

    In my original example I want the formula to search the range B1:B4 to give me the row number that it matches to, which is row 2 from my example.

  9. #9
    Registered User
    Join Date
    01-25-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Use array formula for range using search

    I'll attach a file. Right now the formula works if you do it by cell. It shows a TRUE for C2. Instead of copying down the formula, I would like it to find the row numbers for the rows with TRUE without creating a column C.
    I would copy down this formula down if there are multiple matches. I would probably use the small function to find multiple matches. So "small(if....rows(A1:A1)"

    It is trickier than I thought.
    Attached Files Attached Files

  10. #10
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Use array formula for range using search

    Hi.

    So what are your expected results for the attached, and in which cell(s) should these results be placed?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  11. #11
    Registered User
    Join Date
    01-25-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Use array formula for range using search

    The formula can be placed in C1.
    My expected result is 2 since that is where the criteria matches.
    There could be multiple matches so a small(if or other similar function would need to be combined with the formula in the spreadsheet.

  12. #12
    Registered User
    Join Date
    01-25-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Use array formula for range using search

    I'm wondering if the sumproduct is causing the issue in that it can't work with arrays. Instead of sumproduct maybe use sum(if.

  13. #13
    Registered User
    Join Date
    01-25-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Use array formula for range using search

    l've used the search function in arrays before but not sumproduct. Could I use the Aggregate function in place of the sumproduct. It probably work faster as well.

+ 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. Can I make the row lookup array/range part in an array formula variable?
    By OLLY-7 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-18-2014, 09:06 AM
  2. [SOLVED] Evaluate Named Range Array formula to VBA Array
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-07-2014, 09:06 PM
  3. Modify this Search Formula to search across a range of cells
    By zicitron in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-16-2013, 08:11 AM
  4. Search for Value in array given range of values in another column.
    By pjw842 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-21-2013, 06:55 PM
  5. [SOLVED] SEARCH whole word when in an array formula
    By pdauction in forum Excel General
    Replies: 2
    Last Post: 04-16-2012, 08:24 AM
  6. Search Using an Array Formula...
    By teshiburu1988 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-30-2009, 06:58 PM
  7. [SOLVED] Tricky array formula issue - Using array formula on one cell, then autofilling down a range
    By aspenbordr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-27-2005, 11:05 AM

Tags for this Thread

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