+ Reply to Thread
Results 1 to 7 of 7

Column if words as filter

Hybrid View

  1. #1
    Registered User
    Join Date
    01-16-2014
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2011 Mac
    Posts
    25

    Column if words as filter

    Hi

    I have a column of sentences in column A and a column of single words in column B. I want those sentences in column A that contain one or more of the words in column B to appear in a new column; column C.

    I also want the formula to work in such a manner that if a new word is written in the column B or a word is deleted, or if a sentence in column A is replaced or removed or a new is inserted, the list in column C will update automatically according to the changes in column A and B.

    The length of the column of sentences and words in A and B must hence be able to change, and hence so must the length of the list of sentences in column C.


    This works in google.docs with the following formula:

    =FILTER('Sheet1'!A1:A;MMULT(SEARCH(TRANSPOSE(" "&B1:B&" ");" "&'Sheet1'!A1:A&" ");SIGN(ROW('Sheet1'!A1:A))))


    After several rounds of feedback from forum users, I have tried entering these formulas in excel (as arrays in the correct manner), but none of them can do the task:

    =IF(SUMPRODUCT((ROWS($B$1:$B$4)*(COUNTIF(A1,"*"&$B$2:$B$4&"*"))))>0,A2,"")

    =IF(OR(ISNUMBER(SEARCH($B$1:$B$1,A1))),A1,"")

    =IF(COUNT(INDEX(SEARCH($B$1:$B$4,A1),0)),A2,"")

    =IFERROR(INDEX(A:A,SMALL(IF(FREQUENCY(IF(ISNUMBER(SEARCH(TRANSPOSE($B$1:$B$4),$A$1:$A$5)),ROW($A$1:$A$5)),ROW($A$1:$A$5)),ROW($A$1:$A$5)),ROWS($2:2))),"")


    Some of these produce a list of sentences in C, but not in the manner described that works with the google docs formula.

    I can hardly believe that this is possible to do in google docs but not in excel. I want to use excel because the processing capacity in google docs is rather limited when applied to large amounts of data, compared to excel.


    If anybody is able to help it is greatly appreciated.


    Regards, Njaal, Norway.
    Attached Files Attached Files

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

    Re: Column if words as filter

    Hi,

    Try this array formula:

    =IFERROR(INDEX(A:A,SMALL(IF(FREQUENCY(IF(ISNUMBER(SEARCH(TRANSPOSE(IF($B$1:$B$4<>""," "&$B$1:$B$4&" "))," "&$A$1:$A$5&" ")),ROW($A$1:$A$5)),ROW($A$1:$A$5)),ROW($A$1:$A$5)),ROWS($1:1))),"")

    Regards
    Click * below if this answer helped

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

  3. #3
    Registered User
    Join Date
    01-16-2014
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2011 Mac
    Posts
    25

    Re: Column if words as filter

    Does not work. It does appear to do the trick, but when I write "why is this happening" in A6 and write "why" in B2, then the sentence "why is this happening does not appear in C3.

    I need the formula to allow the list in column A and B to be of such length that it is possible to add many more sentences and words, with the list of sentences in column C adapting accordingly.

    If you try the google docs formula in a google docs spreadsheet, you will see that you will be able to write new sentences in A or new words in B, and the list in C will adapt accordingly, no matter how many new sentences or words you add.

    Thank you for trying though, regards.

    Any other suggestions?
    Last edited by njaalgw@gmail.com; 01-26-2014 at 02:43 PM.

  4. #4
    Registered User
    Join Date
    01-16-2014
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2011 Mac
    Posts
    25

    Re: Column if words as filter

    So in essence, I need a formula that works in excel in the same manner as the google docs formula works in google docs
    Last edited by njaalgw@gmail.com; 01-26-2014 at 02:44 PM.

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

    Re: Column if words as filter

    But this is nothing to do with the formula itself (did you extend the ranges to row 6 and re-calculate?) but only to do with the fact that the ranges have not been set dynamically.

    I presumed that this was merely a secondary concern of yours (and something which you were capable of doing yourself), after obtaining the correct syntax for the formula in Excel. Apologies if this presumption was incorrect: there are several ways to make ranges dynamic, including:

    Go to Name Manager and define two new ranges thus:

    Name: Sentences
    Refers to: =Sheet1!$A$1:INDEX(Sheet1!$A:$A,MATCH(REPT("z",255),Sheet1!$A:$A))

    Name: Keywords
    Refers to: =Sheet1!$B$1:INDEX(Sheet1!$B:$B,MATCH(REPT("z",255),Sheet1!$B:$B))

    (Obviously amend the column and starting references to match your actual set-up. I note that you also made no mention of the possibility of blanks anywhere between the first and last non-blank entries within either of these ranges, so this is assumed to be the case.)

    Your (array) formula is then:

    =IFERROR(INDEX(Sentences,SMALL(IF(FREQUENCY(IF(ISNUMBER(SEARCH(TRANSPOSE(IF(Keywords<>""," "&Keywords&" "))," "&Sentences&" ")),ROW(Sentences)),ROW(Sentences)),ROW(Sentences)),ROWS($1:1))),"")

    and will respond dynamically to additions/deletions to either list.

    Regards
    Last edited by XOR LX; 01-26-2014 at 02:48 PM.

  6. #6
    Registered User
    Join Date
    01-16-2014
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2011 Mac
    Posts
    25

    Re: Column if words as filter

    That is great.

    My bad for not explaining, I am fairly new to this.

    Thank you very much, you saved my day!

    Regards, Njaal, Norway.

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

    Re: Column if words as filter

    You're welcome.

+ 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] Column of single words as filter for columns with sentences
    By njaalgw@gmail.com in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 12
    Last Post: 01-23-2014, 12:11 PM
  2. Column of words as filter for column of sentences
    By njaalgw@gmail.com in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-20-2014, 04:03 PM
  3. [SOLVED] Filter a column containing sentences with a column of words
    By njaalgw@gmail.com in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-17-2014, 10:41 AM
  4. Replies: 18
    Last Post: 11-29-2012, 07:43 AM
  5. Counting words in one column to count words in another column
    By stuart1133 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-16-2010, 05:54 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