+ Reply to Thread
Results 1 to 7 of 7

Check if a cell contains a word in listA, if not, then check if it contains a word in list

  1. #1
    Registered User
    Join Date
    02-29-2024
    Location
    Lima
    MS-Off Ver
    Office 365 latest
    Posts
    3

    Post Check if a cell contains a word in listA, if not, then check if it contains a word in list

    Hi there!


    little background:
    I have two sheets: "Sheet1" and "Keywords", the "Keywords" sheet has two keywords columns ( H & G ) and a category column ( D ), and "Sheet1" has a description column (Column E).

    Requirement:
    The description cell should contain keywords from both keyword columns ( at least one from H and one from G), if it does, then the formula should return the category ( D ), if it doesn't however, then it should check it against the next row in the keywords column and so on.

    What I have done:
    Please Login or Register  to view this content.
    The problem with this code:
    this code works perfectly, but the issue is that excel limits me to ~8000 characters, so I can't go through the whole keywords columns.


    Is there more efficient way of doing this? a simple FOR loop would suffice but excel doesn't support them afaik.

    Your help is much appreciated!
    Last edited by mrbatata; 02-29-2024 at 01:56 PM. Reason: solved

  2. #2
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Check if a cell contains a word in listA, if not, then check if it contains a word in

    Welcome to the forum.

    Please attach a file so we can help you.

  3. #3
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,463

    Re: Check if a cell contains a word in listA, if not, then check if it contains a word in

    Cross posted question... same question appears in the MrExcel forum.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,054

    Re: Check if a cell contains a word in listA, if not, then check if it contains a word in

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not told us about this. You are required to do so. Cross-posts are allowed but you must provide a link to your posts on other sites.

    Please see Forum Rule #7 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important: https://excelguru.ca/a-message-to-forum-cross-posters/

    (Note: this requirement is not optional. I shall do it for you this time as you are new here: https://www.mrexcel.com/board/thread...b-etc.1254812/)

    Cross posted question... same question appears in the MrExcel forum.
    Please use the Report Post button. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    02-29-2024
    Location
    Lima
    MS-Off Ver
    Office 365 latest
    Posts
    3

    Re: Check if a cell contains a word in listA, if not, then check if it contains a word in

    Quote Originally Posted by DJunqueira View Post
    Welcome to the forum.

    Please attach a file so we can help you.
    Thank you!
    Sorry I didn't think of that earlier. However, I already got the answer in techcommunity forum ( the editor here won't let me post the link for some reason ) , so thank you all
    Quote Originally Posted by Rick Rothstein View Post
    Cross posted question... same question appears in the MrExcel forum.
    Sorry I didn't know it's against the rules.. my bad

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,054

    Re: Check if a cell contains a word in listA, if not, then check if it contains a word in

    If it wasn't Mr Excel, then you MUST post the link - add ONE space to it so that you can post it.

    Then mark the thread as solved. And read our rules, please.

  7. #7
    Registered User
    Join Date
    02-29-2024
    Location
    Lima
    MS-Off Ver
    Office 365 latest
    Posts
    3

    Re: Check if a cell contains a word in listA, if not, then check if it contains a word in

    it's not allowing me even when I put spaces between each word in the link as shown below:
    Screenshot 2024-02-29 215438.png

+ 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. Replies: 5
    Last Post: 06-11-2018, 10:40 AM
  2. Replies: 3
    Last Post: 09-28-2015, 07:35 AM
  3. Check the number of occurences of a word in a list
    By Askalian in forum Excel General
    Replies: 0
    Last Post: 02-05-2013, 09:19 PM
  4. Check cell for word, If word exists in cell, assign that cell to corresponding category.
    By Trevasaurus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2012, 12:35 PM
  5. Replies: 3
    Last Post: 09-28-2012, 11:12 AM
  6. [SOLVED] VBA word (2003) codes to check if a table fits in a single page of the word document
    By samkumar in forum Word Programming / VBA / Macros
    Replies: 7
    Last Post: 08-27-2012, 09:35 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