+ Reply to Thread
Results 1 to 21 of 21

Find and mark values

  1. #1
    Forum Contributor
    Join Date
    03-18-2010
    Location
    FL
    MS-Off Ver
    Excel 2016
    Posts
    147

    Find and mark values

    Hi, need a formula to find a value from another cell. Please see file attached. I need to find if a value in column B and C is in column A and put the output in column D. The output can be be Yes or Np.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Find and mark values

    Try this:

    =IFERROR(IF(LOOKUP(1000,SEARCH(B2,A2),"")&LOOKUP(1000,SEARCH(C2,A2),"")="","Yes"),"No")
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Find and mark values

    Try

    =IFERROR(IF(AND(SEARCH(B3,A3),SEARCH(C3,A3)),"Yes"),"No")

  4. #4
    Forum Contributor
    Join Date
    03-18-2010
    Location
    FL
    MS-Off Ver
    Excel 2016
    Posts
    147

    Re: Find and mark values

    Thank you both but it doesn't give accurate results. Please see attached.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Find and mark values

    You have the formulae wrongly associated with names! What result do you expect for row 2 as RED doesn't exist anywhere in the data?

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Find and mark values

    This

    =IFERROR(IF(SEARCH(B3,A3),"yes"),IFERROR(IF(SEARCH(C3,A3),"Yes"),"No"))

  7. #7
    Forum Contributor
    Join Date
    03-18-2010
    Location
    FL
    MS-Off Ver
    Excel 2016
    Posts
    147

    Re: Find and mark values

    Thanks. I will be make it this way, please see new sheet. Formula needs to find any value in A1 for example in all column B.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Find and mark values

    I think you will need to parse the data in A into separate words and then use SEARCH to find any matches.

  9. #9
    Forum Contributor
    Join Date
    03-18-2010
    Location
    FL
    MS-Off Ver
    Excel 2016
    Posts
    147

    Re: Find and mark values

    I can't, in most cases column A have more than 10 words. I think it should be a simple formula. Thank you.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Find and mark values

    It's column B that will need separating out.

    Please don't tell your highly experienced helpers that it should be a simple formula when you are here asking how to do it: clearly, you are not the one to judge the complexity of the problem, otherwise you would not need to ask for help.

  11. #11
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Find and mark values

    Maybe try

    =IF(SUMPRODUCT(COUNTIFS(B$2:B$8,"*"&FILTERXML("<x><m>"&SUBSTITUTE(A2," ","</m><m>")&"</m></x>","//m")&"*")),"Yes","No")

    I don't think this is a simple formula.
    Attached Files Attached Files

  12. #12
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Find and mark values

    ARRAY formula

    =IFERROR(IF(SUM(1*(ISNUMBER(SEARCH(B2,$A$2:$A$3))),1*(ISNUMBER(SEARCH(C2,$A$2:$A$3)))),"Yes","No"),"")

    To enter ARRAY formula
    Copy and paste the formula in cell
    Press F2
    Press Ctrl+Shift+Enter together
    Excel covers the formula with {}.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  13. #13
    Forum Contributor
    Join Date
    03-18-2010
    Location
    FL
    MS-Off Ver
    Excel 2016
    Posts
    147

    Re: Find and mark values

    Quote Originally Posted by AliGW View Post
    It's column B that will need separating out.

    Please don't tell your highly experienced helpers that it should be a simple formula when you are here asking how to do it: clearly, you are not the one to judge the complexity of the problem, otherwise you would not need to ask for help.
    Sorry, there was no bad intention, it is clear im not the one who knows excel here.

  14. #14
    Forum Contributor
    Join Date
    03-18-2010
    Location
    FL
    MS-Off Ver
    Excel 2016
    Posts
    147

    Re: Find and mark values

    Thank you. A bit better, please see attached. I checked few results and some were wrong. Can you check? Maybe we need to make some tuning to the formula.
    Attached Files Attached Files

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Find and mark values

    Does this work for you?

    =IFERROR(IF(SUM(1*(ISNUMBER(SEARCH(B2,$A$2:$A$247)))),"Yes","No"),"")

  16. #16
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Find and mark values

    Form what I interpret.

    Only 1 wrong is A13 "T" is every what in Column B

    There are "Dog" in A12, A226, B37
    There are "Pet" in A66, A73 and B44, B46, B69, B78

    =IF(COUNT(SEARCH(TRANSPOSE(" "&FILTERXML("<x><m>"&SUBSTITUTE(A2," ","</m><m>")&"</m></x>","//m")&" ")," "&$B$2:$B$91&" ")),"Yes","No")

    Unless you want case sensitive, change Search to Find

    =IF(COUNT(Find(TRANSPOSE(" "&FILTERXML("<x><m>"&SUBSTITUTE(A2," ","</m><m>")&"</m></x>","//m")&" ")," "&$B$2:$B$91&" ")),"Yes","No")

    These formula need to confirm with Ctrl+Shift+Enter
    Attached Files Attached Files

  17. #17
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Find and mark values

    Please Login or Register  to view this content.
    Results in column G: Search matching words in column A with those in B
    Attached Files Attached Files

  18. #18
    Forum Contributor
    Join Date
    03-18-2010
    Location
    FL
    MS-Off Ver
    Excel 2016
    Posts
    147

    Re: Find and mark values

    Will try, thanks.

  19. #19
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Find and mark values

    I pasted the results of Bo_Ry formulae into the w/book and compared the results to the UDF and only found 2 differences between column D formula and UDF.

    The common factor in both cases is there is "&" in the text. I don't know if that has any bearing on the formulae used, and as I don't have a current version of Excel, I can't test this "hypothesis".

    See attached (marked in yellow).
    Attached Files Attached Files
    Last edited by JohnTopley; 04-11-2021 at 06:43 AM.

  20. #20
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Find and mark values

    FilterXML doesn't like &

    use this
    =IF(COUNT(SEARCH(TRANSPOSE(" "&FILTERXML("<x><m>"&SUBSTITUTE(SUBSTITUTE(A2,"&","&amp;")," ","</m><m>")&"</m></x>","//m")&" ")," "&$B$2:$B$91&" ")),"Yes","No")

    for Excel 2010 where FILTERXML is not available try this

    =IF(COUNT(INDEX(SEARCH(" "&TRIM(MID(SUBSTITUTE(A2," ",REPT(" ",99)),COLUMN(A$1:INDEX(A$1:I$1,LEN(A2)-LEN(SUBSTITUTE(A2," ",))+1))*99-98,99))&" "," "&$B$2:$B$91&" "),)),"Yes","No")
    Attached Files Attached Files

  21. #21
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Find and mark values

    @Bo_Ry
    It appears my hypothesis is correct! Anyway, you have resolved it.

    Thank you for the 2010 formula - if I can get my head round it!!!

+ 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] Find substring by mark
    By arbazhamayun in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-01-2018, 06:40 AM
  2. Find Specific words/values in Columns and mark them
    By Rolandelo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-25-2015, 06:15 AM
  3. How to find question mark symbol
    By steve777888 in forum Excel General
    Replies: 4
    Last Post: 02-03-2013, 10:47 PM
  4. I can't find check mark
    By TToye in forum Excel General
    Replies: 2
    Last Post: 08-20-2012, 04:10 AM
  5. Find Max and Min Values every 10 rows & Mark row as keep
    By Jmino in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-24-2010, 02:22 AM
  6. Find and mark cell
    By hafizfarooq in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2008, 05:24 AM
  7. [SOLVED] Find and mark duplicates
    By maxtrixx in forum Excel General
    Replies: 3
    Last Post: 05-05-2005, 10:06 PM

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