Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to check if cell contains one of several values in Excel?

doc check if multiple values 1

Supposing, you have a list of text strings in column A, now, you want to test each cell if it contains one of several values based on another range D2:D6. If it contains any of the specific text in D2:D6, it will display True, otherwise, it will show False as following screenshot shown. This article, I will talk about how to identify a cell if it contains one of several values in another range.

Check if a cell contains one of several values with formulas


arrow blue right bubble Check if a cell contains one of several values with formulas


To check if a cell content contains any one of the text values in another range, the following formulas may help you, please do as this:

Enter this formula: =SUMPRODUCT(--ISNUMBER(SEARCH($D$2:$D$6,A2)))>0 into a blank cell where you want to locate the result, B2, for instance, then drag the fill handle down to the cells that you want to apply this formula, and if the cell has any of the text values in another specific range, it will get True, otherwise, it will get False. See screenshot:

doc check if multiple values 2

Notes:

1. If you would like use “Yes” or “No’ to indicate the result, please apply this formula: =IF(SUMPRODUCT(--ISNUMBER(SEARCH($D$2:$D$6,A2))),"Yes","No"), and you will get the following result as you need, see screenshot:

doc check if multiple values 3

2. In the above formulas, D2:D6 is the specific data range which you want to check the cell based on, and A2 is the cell that you want to check.


Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Muhammed Tahreem Alam · 4 days ago
    Please check
  • To post as a guest, your comment is unpublished.
    Muhammed Tahreem Alam · 4 days ago
    Hey,
    I tried this formula, but it is showing TRUE for everything?
  • To post as a guest, your comment is unpublished.
    Nils · 5 months ago
    Would it be possible to change the result of this formula from just being 'TRUE' , 'FALSE', 'Yes', or 'No', into the value of the specific text?


    Thank you
    • To post as a guest, your comment is unpublished.
      skyyang · 4 months ago
      Hi, Nils,
      If you want to use other text to instead the "Yes" or "No", you just need to replace the "Yes", "No" with other texts, please try the below formula:
      =IF(SUMPRODUCT(--ISNUMBER(SEARCH($D$2:$D$6,A2))),"your specific text1","your specific text2")

      Please try it, hope it can help you!
      • To post as a guest, your comment is unpublished.
        Alex · 4 months ago
        Jane asked below "Same question; Can we return the text that was matched rather than yes/no?" - also interested in the answer
        • To post as a guest, your comment is unpublished.
          Lorraine · 7 days ago
          =IF(SUMPRODUCT(--ISNUMBER(SEARCH($D$2:$D$6,A2))),"Yes,"No")
  • To post as a guest, your comment is unpublished.
    Jane · 5 months ago
    Same question; Can we return the text that was matched rather than yes/no?
  • To post as a guest, your comment is unpublished.
    Emily · 5 months ago
    Any way to return the text that matches in the cell rather than a yes or no?
  • To post as a guest, your comment is unpublished.
    · 6 months ago
    YES, NO 가아닌 메칭되는 값(KTE,remove) 들어있는 값이 보이게 넣을수는 없나요?

    중복되는 값 배열일 경우 배열로 B열 C열......... 기재는 가능한가요
  • To post as a guest, your comment is unpublished.
    carla · 6 months ago
    used =SUMPRODUCT(--ISNUMBER(SEARCH(list,A2))) along with conditional formatting to help compare the values of one column with another. works great with excel 2007. been racking my brain for days.
  • To post as a guest, your comment is unpublished.
    shl · 9 months ago
    유용한 자료 감사합니다!
  • To post as a guest, your comment is unpublished.
    Reece · 10 months ago
    Thanks heaps, this worked.
  • To post as a guest, your comment is unpublished.
    goldwater · 11 months ago
    감사합니다 정말 진심으로 감사드립니다
    한달여간을 네이버에서만 찾다가 구글을 통해 찾으니 이렇게 바로 정확한 정보가 뜨네요 정말 감사드립니다 !
  • To post as a guest, your comment is unpublished.
    sam · 1 years ago
    hi
    see attached file, im trying to find out if any of the ingredients from column D exists in column A and display whatever ingredient thats found in column B, is this possible?
    • To post as a guest, your comment is unpublished.
      sam · 1 years ago
      first attachment didnt upload, see below attachment
  • To post as a guest, your comment is unpublished.
    Alex Ezorsky · 1 years ago
    How would I make this work if there were blank cells in the D column?
  • To post as a guest, your comment is unpublished.
    Thach David Ho · 2 years ago
    Very useful fomula.
    Can we grab that value found from the search? (i.e. I want to check if the address field containing the 4 digit post code within the range, if yes then show value of the 4 digits post code.)
    David
    • To post as a guest, your comment is unpublished.
      skyyang · 2 years ago
      Hi, David,
      My be this array formula can help you:
      =IF(SUMPRODUCT(IF(ISNUMBER(SEARCH($D$2:$D$4,A2)),ROW($D$2:$D$4)-ROW($D$2)+1,0))>0,INDEX($D$2:$D$4,SUMPRODUCT(IF(ISNUMBER(SEARCH($D$2:$D$4,A2)),ROW($D$2:$D$4)-ROW($D$2)+1,0))))
      After pasting the formula, please press Shift + Ctrl + Enter keys together.
      This formula is somewhat complex, please change the cell references to your need.
      Please try it, hope it can help you!
      • To post as a guest, your comment is unpublished.
        Bruno Pace · 1 months ago
        skyyang,

        I don't know if you ever gonna read this, but thank you so much!

        You are a Genius!!!
      • To post as a guest, your comment is unpublished.
        Yogesh · 9 months ago
        Can the list in Column D be of 15000 words and still the formula remains same as mentioned above? I am getting expected results with just few values but the moment list jumps to thousands, it all shows #REF.
      • To post as a guest, your comment is unpublished.
        Tina M Morris · 10 months ago
        Myself and another gal have been trying to figure this one out for 2 days for a data problem we have to resolve. Thank you for this expression. It is exactly what we needed.
      • To post as a guest, your comment is unpublished.
        sam · 1 years ago
        i have a list of ingredients in column A, each cell has the whole ingredients of a product so its not just one word, in column D i have a the list of ingredients im trying to find within column A, how do i that? this formula doesnt seem to work 100% for this
        thanks
      • To post as a guest, your comment is unpublished.
        sam · 1 years ago
        does this formula work when there is a couple of words in the lookup cells and couple of words in the search in cells? basically i have lists of ingredients and want to locate some specific ingredient from within those list and the specific ingredient might be more than one word
      • To post as a guest, your comment is unpublished.
        Alex Ezorsky · 1 years ago
        This is amazing! One big issue for me however: What if there are blank cells in my "search for" D2:D4 list. For me it ruins the formula and I just get "NUM" in a few places. THANKS!
      • To post as a guest, your comment is unpublished.
        Thach David Ho · 2 years ago
        Amazing, it works exactly the way that I needed. Thank you Champs.
        • To post as a guest, your comment is unpublished.
          skyyang · 2 years ago
          Glad to help you!
          • To post as a guest, your comment is unpublished.
            geenie · 1 years ago
            hi, would you please explain how you got that function above? I'm trying to do the same thing but cannot seem to change the cell references correctly.
            • To post as a guest, your comment is unpublished.
              Jon · 1 years ago
              Yes please, I need this too. I can't see why $D$2 is locked?
  • To post as a guest, your comment is unpublished.
    Dev · 2 years ago
    What if the "specific text" column contains phrases?
    For example
    "remove duplicate"
    "convert text"
    "find across"

    how to check then?