📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Excel skills are failing me

MyRealNameToo
MyRealNameToo Posts: 1,198 Forumite
1,000 Posts Name Dropper
edited 4 September at 10:41AM in Techie Stuff
I have a list of notes (B) that people have put into a form in a XLS. I am trying to see which of these contain certain keywords held in a seperate column (M) so my formula is currently:

=Or(IsNumber(Search(M$2:M$9, B3)))

Drag this down so B3 adjusts for the 20,000 odd rows. This therefore returns a True if any of the keywords are present and False if they arent.

Problem is that if I add a new key term I then need to change M$9 to M$10 and I can't just do M$100 as the blank cells match and suddenly everything becomes True

I need to do some form of indirect lookup which in principle can be done using CountA but can't think how to do a range where the first cell is know and the end cell is calculated. 

Comments

  • saajan_12
    saajan_12 Posts: 5,175 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Combo Breaker
    Few options:
    1) move the list of key words to another tab. Then when you want to add a key word, insert a row somewhere between row 2 and row 9. That way the key words will become row 2:10, but the formulas in your search formula will automatically update for the inserted row. 

    2) The cell reference you're looking for is "M$2:M$"&counta(M$2:M:$100)+1
    Then your formula to copy down is just =isnumber(search(indirect( "M$2:M$"&counta(M$2:M:$100)+1 )),B3))
    I think that's what you were trying to do, but warning, indirect cell references are inherently not dynamic, so if you insert a row or change anything else it can get unstable. 

    3) Filter the list of keywords for non blank entries. So = isnumber( search( filter( M$2:M$100, len(M$2:M$100) > 0) ,B3))
  • MyRealNameToo
    MyRealNameToo Posts: 1,198 Forumite
    1,000 Posts Name Dropper
    Thanks, 2 is what I was trying to do

    Others may be adding keywords so option 1 whilst simple is probably unreliable. Actually 3 may be the better option in case someone just deletes a row leaving a blank in the middle of the list. 
  • Exodi
    Exodi Posts: 4,091 Forumite
    Eighth Anniversary 1,000 Posts Wedding Day Wonder Name Dropper
    edited 4 September at 12:51PM
    It's hard to test without the data you're using however, I can do this dynamically with:

    =OR(ISNUMBER(SEARCH(OFFSET(Sheet1!$M$2,0,0,COUNTA(Sheet1!$M$2:$M$1000),1),B3)))

    Drag down. This works dynamically (well pseudo-dynamically depending on how massive you specify the range) if I add values to the M column - does that work for you?


    Know what you don't
  • Vitor
    Vitor Posts: 787 Forumite
    500 Posts First Anniversary Photogenic Name Dropper
    edited 4 September at 3:34PM
    If you're using a relatively recent Excel try this, assuming your 'notes' start from B3 and your keywords are in M2 and potentially extend to M100. Put this in C3

    =BYROW(B3:B20000, LAMBDA(note, LET(
        kws, FILTER(M$2:M$100, M$2:M$100 <> ""),
        OR(ISNUMBER(SEARCH(kws, note)))
    )))


    This checks each row in B3:B20000 against the keyword list.
    It spills the results vertically.
    You only need to enter it once, no dragging needed.
    It automatically fills the output column from top to bottom.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 351.6K Banking & Borrowing
  • 253.3K Reduce Debt & Boost Income
  • 453.9K Spending & Discounts
  • 244.5K Work, Benefits & Business
  • 599.8K Mortgages, Homes & Bills
  • 177.2K Life & Family
  • 258.1K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.2K Discuss & Feedback
  • 37.6K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.