{"id":3831,"date":"2019-01-02T17:12:30","date_gmt":"2019-01-02T17:12:30","guid":{"rendered":"http:\/\/officetuts.net\/excel\/?p=3831"},"modified":"2024-03-29T13:51:58","modified_gmt":"2024-03-29T13:51:58","slug":"if-cells-contain-specific-text","status":"publish","type":"post","link":"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/","title":{"rendered":"Excel if Cells Contain Specific Text"},"content":{"rendered":"\n
Excel-if-Cells-Contain-Specific-Text<\/a>Download File<\/a><\/div>\n\n\n\n

To check whether a cell contains specific text, you can use the SEARCH function<\/a>. This function will return the position of the first match and the #VALUE!<\/strong> error otherwise.<\/p>\n\n\n\n

Because we don\u2019t want to have errors in our formula, we are going to use the SEARCH<\/strong> function with the ISNUMBER function<\/a>. ISNUMBER<\/strong> returns TRUE<\/strong> if there is a number and FALSE<\/strong> if there is anything else.<\/p>\n\n\n\n

The following formula will return TRUE<\/strong> if there is specific text inside a cell, and FALSE<\/strong> otherwise. This version is case-insensitive.<\/p>\n\n\n\n

=ISNUMBER(SEARCH(substring,string))<\/pre>\n\n\n\n

If you want to use the case-sensitive version, you can use the following formula.<\/p>\n\n\n\n

=ISNUMBER(FIND(substring,string))<\/pre>\n\n\n\n

If cells contain the specific text then count<\/h2>\n\n\n\n

Here, we are going to count all cells that contain the specified text<\/a>. There are two ways to count these cells. In this case, we are going to use the following formulas:<\/p>\n\n\n\n

    \n
  1. Count cells that contain the entire text and nothing more.<\/li>\n<\/ol>\n\n\n\n
    =COUNTIF(A1:C4,\"six\")<\/pre>\n\n\n\n
      \n
    1. Count cells that contain the specified text.<\/li>\n<\/ol>\n\n\n\n
      =COUNTIF(A1:C4,\"*six*\")<\/pre>\n\n\n\n
      \"\"<\/figure>\n\n\n\n

      In the first example (C6<\/strong>), Excel will return 1 because only one cell (B2<\/strong>) meets the criteria.<\/p>\n\n\n\n

      The second example will return three because cells B2<\/strong>, C2<\/strong>, and C3<\/strong> meet the criteria.<\/p>\n\n\n\n

      If cells contain the specific text then return value in another cell<\/h2>\n\n\n\n

      We can simply modify this example to copy the cell to a different column if the cell contains<\/a> the specific text.<\/p>\n\n\n\n

      Copy all the data<\/a> from A1<\/strong> to C4<\/strong> to column A<\/strong>.<\/p>\n\n\n\n

      Inside cell B1<\/strong>, enter the following formula:<\/p>\n\n\n\n

      =IF(COUNTIF(A1,\"*six*\")>0,A1,\"-\")<\/pre>\n\n\n\n

      This formula checks whether there is \u201csix\u201d inside cell A1. If TRUE, it copies cell A1 to B1. If FALSE it inserts a dash. Autofill the remaining cells to get the following result.<\/p>\n","protected":false},"excerpt":{"rendered":"

      To check whether a cell contains specific text, you can use the SEARCH function. This function will return the position of the first…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[170,190],"yoast_head":"\nExcel if Cells Contain Specific Text<\/title>\n<meta name=\"description\" content=\"Learn how to check whether a cell in Excel contains specific text using the SEARCH function with our guide. Download the example file and try the formulas yourself.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Excel if Cells Contain Specific Text\" \/>\n<meta property=\"og:description\" content=\"Learn how to check whether a cell in Excel contains specific text using the SEARCH function with our guide. Download the example file and try the formulas yourself.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-02T17:12:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-29T13:51:58+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/count-cells.png\" \/>\n<meta name=\"author\" content=\"Tomasz Decker\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tomasz Decker\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/\"},\"author\":{\"name\":\"Tomasz Decker\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"headline\":\"Excel if Cells Contain Specific Text\",\"datePublished\":\"2019-01-02T17:12:30+00:00\",\"dateModified\":\"2024-03-29T13:51:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/\"},\"wordCount\":283,\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/count-cells.png\",\"keywords\":[\"file\",\"pinterest\"],\"articleSection\":[\"formulas\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/\",\"url\":\"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/\",\"name\":\"Excel if Cells Contain Specific Text\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/count-cells.png\",\"datePublished\":\"2019-01-02T17:12:30+00:00\",\"dateModified\":\"2024-03-29T13:51:58+00:00\",\"description\":\"Learn how to check whether a cell in Excel contains specific text using the SEARCH function with our guide. Download the example file and try the formulas yourself.\",\"breadcrumb\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/#primaryimage\",\"url\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/count-cells.png\",\"contentUrl\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/count-cells.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/officetuts.net\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Excel if Cells Contain Specific Text\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/officetuts.net\/excel\/#website\",\"url\":\"https:\/\/officetuts.net\/excel\/\",\"name\":\"\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/officetuts.net\/excel\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\",\"name\":\"Tomasz Decker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"caption\":\"Tomasz Decker\"},\"logo\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\"},\"description\":\"Spreadsheet and Python enthusiast.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Excel if Cells Contain Specific Text","description":"Learn how to check whether a cell in Excel contains specific text using the SEARCH function with our guide. Download the example file and try the formulas yourself.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/","og_locale":"en_US","og_type":"article","og_title":"Excel if Cells Contain Specific Text","og_description":"Learn how to check whether a cell in Excel contains specific text using the SEARCH function with our guide. Download the example file and try the formulas yourself.","og_url":"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/","article_published_time":"2019-01-02T17:12:30+00:00","article_modified_time":"2024-03-29T13:51:58+00:00","og_image":[{"url":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/count-cells.png"}],"author":"Tomasz Decker","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tomasz Decker","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/#article","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/"},"author":{"name":"Tomasz Decker","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"headline":"Excel if Cells Contain Specific Text","datePublished":"2019-01-02T17:12:30+00:00","dateModified":"2024-03-29T13:51:58+00:00","mainEntityOfPage":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/"},"wordCount":283,"publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"image":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/#primaryimage"},"thumbnailUrl":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/count-cells.png","keywords":["file","pinterest"],"articleSection":["formulas"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/","url":"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/","name":"Excel if Cells Contain Specific Text","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/#website"},"primaryImageOfPage":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/#primaryimage"},"image":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/#primaryimage"},"thumbnailUrl":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/count-cells.png","datePublished":"2019-01-02T17:12:30+00:00","dateModified":"2024-03-29T13:51:58+00:00","description":"Learn how to check whether a cell in Excel contains specific text using the SEARCH function with our guide. Download the example file and try the formulas yourself.","breadcrumb":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/#primaryimage","url":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/count-cells.png","contentUrl":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/count-cells.png"},{"@type":"BreadcrumbList","@id":"https:\/\/officetuts.net\/excel\/formulas\/if-cells-contain-specific-text\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/officetuts.net\/excel\/"},{"@type":"ListItem","position":2,"name":"Excel if Cells Contain Specific Text"}]},{"@type":"WebSite","@id":"https:\/\/officetuts.net\/excel\/#website","url":"https:\/\/officetuts.net\/excel\/","name":"","description":"","publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/officetuts.net\/excel\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42","name":"Tomasz Decker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","caption":"Tomasz Decker"},"logo":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/"},"description":"Spreadsheet and Python enthusiast."}]}},"_links":{"self":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/3831"}],"collection":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/comments?post=3831"}],"version-history":[{"count":6,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/3831\/revisions"}],"predecessor-version":[{"id":14687,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/3831\/revisions\/14687"}],"wp:attachment":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/media?parent=3831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/categories?post=3831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/tags?post=3831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}