{"id":2851,"date":"2018-08-08T11:57:39","date_gmt":"2018-08-08T11:57:39","guid":{"rendered":"http:\/\/officetuts.net\/excel\/?p=2851"},"modified":"2024-04-17T07:46:48","modified_gmt":"2024-04-17T07:46:48","slug":"leave-a-cell-blank-if-the-condition-is-false","status":"publish","type":"post","link":"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/","title":{"rendered":"Leave a Cell Blank if the Condition Is False"},"content":{"rendered":"\n
Leave-a-Cell-Blank-if-the-Condition-Is-False<\/a>Download File<\/a><\/div>\n\n\n\n

The following formula will check cell A1, and if the condition is False<\/strong> (value != 2) it returns blank<\/strong>, otherwise (value = 2) it returns A1.<\/p>\n\n\n\n

A1: 2\nB1: =IF((A1=2),A1,\"\")<\/code><\/pre>\n\n\n\n

Now, when you highlight the formula, you can see that the value of the cell is blank<\/a>, but there is a formula inside.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Let\u2019s say that you have a list of values where you check the condition, and you want to choose only these that return blanks (the condition is not met).<\/p>\n\n\n\n

Take a look at the following example.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

You can\u2019t use the ISBLANK<\/strong> function because it will return FALSE for all cells. The better way here is to use the COUNTBLANK(value)<\/strong> formula. It checks whether the value of a cell<\/a> is blank.<\/p>\n\n\n\n

Let\u2019s say, that you want to keep only the rows with blanks<\/a>.<\/p>\n\n\n\n

Select cells<\/a> from D2 to D6 and use Ctrl + F<\/strong>. Enter \u201c1\u201d and click Find All<\/strong>. Select all the values and click Close<\/strong>.<\/p>\n\n\n\n

In order to remove them, choose Ctrl + –<\/strong> and select Entire Row<\/strong><\/a>.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Now, you have only two rows left.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Make a cell truly blank cell<\/h2>\n\n\n\n

The above code works well, but there is another, more advanced way. This time the code leaves nothing inside a cell, not even a formula. It can\u2019t be achieved only with formulas, we have to use a bit of the VBA code.<\/p>\n\n\n\n

Let\u2019s use the following example:<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n
    \n
  1. Press Alt + F11<\/strong> to open the VBA window.<\/li>\n\n\n\n
  2. Create a new module and insert the following code.<\/li>\n<\/ol>\n\n\n\n
    Function DeleteCellContents(range)\n   ThisWorkbook.Application.Volatile\n   range.Value = \"\"\nEnd Function<\/code><\/pre>\n\n\n\n
    \"\"<\/figure>\n\n\n\n
      \n
    1. Click cell A1<\/strong> and go to Formulas -> Defined Names -> Name Manager<\/strong>. Click New<\/strong>.<\/li>\n<\/ol>\n\n\n\n

      Enter the following text in the fields.<\/p>\n\n\n\n

      Name<\/strong>: CreateTrueBlank,<\/p>\n\n\n\n

      Refers to<\/strong>:<\/p>\n\n\n\n

      =EVALUATE(\"DeleteCellContents(\"&CELL(\"address\",Sheet1!A1)&\")\")<\/code><\/pre>\n\n\n\n
        \n
      1. Enter the following code into B2:<\/li>\n<\/ol>\n\n\n\n
        =IF(A2=0,CreateTrueBlank,A2)<\/code><\/pre>\n\n\n\n

        Caution: This code won\u2019t work if you start from A1 instead of A2 because we created a named range<\/a> there.<\/strong><\/p>\n\n\n\n

        Use Autofill<\/a>, to fill the remaining cells.<\/p>\n\n\n\n

        \"\"<\/figure>\n\n\n\n

        When you highlight cells B4 or B6 you can see that there is no formula there, and if you use the ISBLANK<\/strong> function you can see that this cell has nothing inside.<\/p>\n","protected":false},"excerpt":{"rendered":"

        The following formula will check cell A1, and if the condition is False (value != 2) it returns blank, otherwise (value = 2)…<\/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],"yoast_head":"\nLeave a Cell Blank if the Condition Is False<\/title>\n<meta name=\"description\" content=\"Learn how to leave a cell blank in Excel if a condition is false using a simple IF formula. Download the file and try it 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\/leave-a-cell-blank-if-the-condition-is-false\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Leave a Cell Blank if the Condition Is False\" \/>\n<meta property=\"og:description\" content=\"Learn how to leave a cell blank in Excel if a condition is false using a simple IF formula. Download the file and try it yourself.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-08T11:57:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-17T07:46:48+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/08\/blank-with-formula.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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/\"},\"author\":{\"name\":\"Tomasz Decker\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"headline\":\"Leave a Cell Blank if the Condition Is False\",\"datePublished\":\"2018-08-08T11:57:39+00:00\",\"dateModified\":\"2024-04-17T07:46:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/\"},\"wordCount\":350,\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/08\/blank-with-formula.png\",\"keywords\":[\"file\"],\"articleSection\":[\"formulas\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/\",\"url\":\"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/\",\"name\":\"Leave a Cell Blank if the Condition Is False\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/08\/blank-with-formula.png\",\"datePublished\":\"2018-08-08T11:57:39+00:00\",\"dateModified\":\"2024-04-17T07:46:48+00:00\",\"description\":\"Learn how to leave a cell blank in Excel if a condition is false using a simple IF formula. Download the file and try it yourself.\",\"breadcrumb\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/#primaryimage\",\"url\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/08\/blank-with-formula.png\",\"contentUrl\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/08\/blank-with-formula.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/officetuts.net\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Leave a Cell Blank if the Condition Is False\"}]},{\"@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":"Leave a Cell Blank if the Condition Is False","description":"Learn how to leave a cell blank in Excel if a condition is false using a simple IF formula. Download the file and try it 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\/leave-a-cell-blank-if-the-condition-is-false\/","og_locale":"en_US","og_type":"article","og_title":"Leave a Cell Blank if the Condition Is False","og_description":"Learn how to leave a cell blank in Excel if a condition is false using a simple IF formula. Download the file and try it yourself.","og_url":"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/","article_published_time":"2018-08-08T11:57:39+00:00","article_modified_time":"2024-04-17T07:46:48+00:00","og_image":[{"url":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/08\/blank-with-formula.png"}],"author":"Tomasz Decker","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tomasz Decker","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/#article","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/"},"author":{"name":"Tomasz Decker","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"headline":"Leave a Cell Blank if the Condition Is False","datePublished":"2018-08-08T11:57:39+00:00","dateModified":"2024-04-17T07:46:48+00:00","mainEntityOfPage":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/"},"wordCount":350,"publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"image":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/#primaryimage"},"thumbnailUrl":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/08\/blank-with-formula.png","keywords":["file"],"articleSection":["formulas"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/","url":"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/","name":"Leave a Cell Blank if the Condition Is False","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/#website"},"primaryImageOfPage":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/#primaryimage"},"image":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/#primaryimage"},"thumbnailUrl":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/08\/blank-with-formula.png","datePublished":"2018-08-08T11:57:39+00:00","dateModified":"2024-04-17T07:46:48+00:00","description":"Learn how to leave a cell blank in Excel if a condition is false using a simple IF formula. Download the file and try it yourself.","breadcrumb":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/#primaryimage","url":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/08\/blank-with-formula.png","contentUrl":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/08\/blank-with-formula.png"},{"@type":"BreadcrumbList","@id":"https:\/\/officetuts.net\/excel\/formulas\/leave-a-cell-blank-if-the-condition-is-false\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/officetuts.net\/excel\/"},{"@type":"ListItem","position":2,"name":"Leave a Cell Blank if the Condition Is False"}]},{"@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\/2851"}],"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=2851"}],"version-history":[{"count":16,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/2851\/revisions"}],"predecessor-version":[{"id":12578,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/2851\/revisions\/12578"}],"wp:attachment":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/media?parent=2851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/categories?post=2851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/tags?post=2851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}