{"id":29874,"date":"2023-07-14T14:07:13","date_gmt":"2023-07-14T12:07:13","guid":{"rendered":"https:\/\/www.myexcelonline.com\/?p=29874"},"modified":"2024-03-22T18:24:40","modified_gmt":"2024-03-22T17:24:40","slug":"countif-with-or-logic-in-excel","status":"publish","type":"post","link":"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/countif-with-or-logic-in-excel\/","title":{"rendered":"3 Simple Methods to Explore the Power of COUNTIF with OR Logic in Excel"},"content":{"rendered":"<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/95ADE423-6EDF-43A0-A68C-B4C96C4E032B.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-29943\" title=\"3 Simple Methods to Explore the Power of COUNTIF with OR Logic in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/95ADE423-6EDF-43A0-A68C-B4C96C4E032B-1024x576.png\" alt=\"3 Simple Methods to Explore the Power of COUNTIF with OR Logic in Excel\" width=\"1024\" height=\"576\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/95ADE423-6EDF-43A0-A68C-B4C96C4E032B-1024x576.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/95ADE423-6EDF-43A0-A68C-B4C96C4E032B-300x169.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/95ADE423-6EDF-43A0-A68C-B4C96C4E032B-768x432.png 768w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/95ADE423-6EDF-43A0-A68C-B4C96C4E032B.png 1280w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>Excel is a very <strong>versatile and powerful tool<\/strong> used for data analysis, calculation, and manipulation. One of the most used functions is <a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/countif-formula-excel-2\/\" target=\"_blank\"><strong>COUNITF<\/strong><\/a> in Excel which enables <strong>cell counting based on specific conditions<\/strong>. The<strong> integration of the COUNTIF with OR operator <\/strong>enhances the function&#8217;s flexibility, making it even more powerful.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/countifs-function-in-excel\/\" target=\"_blank\"><strong>COUNTIFS<\/strong><\/a> can be used when we are dealing with <strong>multiple conditions but it uses the AND<\/strong> logic i.e. it will count the cells only when all the conditions are met. What if we want to <strong>count the cells even if at least one criterion is met<\/strong>? This is where COUNTIF with OR comes to our rescue.<\/p>\n<p>In this article, we will be exploring the different ways of applying the COUNTIF with OR logic &#8211;<\/p>\n<p>Let&#8217;s look at each of these one by one.<\/p>\n<h4><strong>Download the Excel Workbook below to follow along and understand How to Use the COUNTIF with OR logic in Excel <\/strong><\/h4>\n<p><a class=\"IRPP_minimalist icon-download\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/COUNTIF-with-OR.xlsx\" target=\"_blank\"><span class=\"ctaText px-3 text-capitalize\"><strong>download excel workbook<\/strong><\/span><span class=\"postTitle px-3\">COUNTIF-with-OR.xlsx<\/span><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span id=\"1\" style=\"color: #ff0000;\">Count cells using a + sign<\/span><\/strong><\/p>\n<p>The easiest way is to <strong>count the values individually<\/strong> and then <strong>use a plus (+) sign<\/strong> to add them together.<\/p>\n<p><strong>=COUNTIF(range, critera1) + COUNTIF(range, criteria2)<\/strong><\/p>\n<p>Let&#8217;s use an example to understand better.<\/p>\n<p>In this example, we have a <strong>table containing the results of a marathon race<\/strong>. Column A contains the names of the competitors, column B is their respective districts, and column C is whether they completed the race or did not complete the race.<\/p>\n<p>We want to find out how many <strong>competitors are from Wellington and Waterloo<\/strong>. We will be using COUNITF to individually count the cells for each criterion and then add them together. The <a class=\"wpil_keyword_link\" title=\"formula\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/top-excel-formulas-function-examples-to-get-better-at-microsoft-excel\/\" target=\"_blank\" rel=\"noopener\" data-wpil-keyword-link=\"linked\">formula<\/a> will be:<\/p>\n<p><strong>=COUNTIF(B2:B25,F1)+COUNTIF(B2:B25,F2)<\/strong><\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/COUNTIF-with-OR-1.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-29902\" title=\"3 Simple Methods to Explore the Power of COUNTIF with OR Logic in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/COUNTIF-with-OR-1.png\" alt=\"3 Simple Methods to Explore the Power of COUNTIF with OR Logic in Excel\" width=\"764\" height=\"420\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/COUNTIF-with-OR-1.png 904w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/COUNTIF-with-OR-1-300x165.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/COUNTIF-with-OR-1-768x422.png 768w\" sizes=\"(max-width: 764px) 100vw, 764px\" \/><\/a><\/p>\n<ul>\n<li><strong>B2:B25<\/strong> specifies the range of cells in which we want to search for matches.<\/li>\n<li><strong>COUNTIF(B2:B25,F1)<\/strong> counts the number of cells within the range B2:B25 that match the value in cell F1 i.e. Wellington.<\/li>\n<li>Similarly, <strong>COUNTIF(B2:B25,F2)<\/strong> counts the number of cells within the range B2:B25 that match the value in cell F2 i.e. Waterloo.<\/li>\n<li>The two COUNTIF results are then added together using the <strong>plus (+) operator<\/strong>.<\/li>\n<\/ul>\n<p>Here, Excel will count the number of cells in the range B2:B25 that contain either &#8220;Wellington&#8221; or &#8220;Waterloo&#8221;, and provide the combined count of those cells. Hence, it will use the COUNTIF with OR logic and provide the results.<\/p>\n<p>&nbsp;<\/p>\n<p><strong><span id=\"2\" style=\"color: #ff0000;\">Count cells using a SUM function<\/span><\/strong><\/p>\n<p>If we have only a few criteria, you can use the plus (+) sign to sum up the COUNTIF function. However, as the<strong> number of criteria increases<\/strong>, this approach can become tedious and cumbersome.<\/p>\n<p>In such situations, a<strong> better approach is to use the SUM function along with COUNTIF and an array formula<\/strong>. This method <strong>simplifies the process<\/strong> and makes it<strong> easier to handle multiple criteria<\/strong> efficiently. The syntax will be &#8211;<\/p>\n<p><strong>{=SUM(COUNTIF(range, criteriarange))}<\/strong><\/p>\n<p>Let&#8217;s use an example to understand better. In this example, we want to find out how many <strong>competitors are from Wellington, Waterloo and Westwood.\u00a0<\/strong>The formula for this using COUNTIF with OR logic will be &#8211;<\/p>\n<p><strong>{=SUM(COUNTIF(B2:B25,F1:F3))}<\/strong><\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/COUNTIF-with-OR-2.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-29905\" title=\"3 Simple Methods to Explore the Power of COUNTIF with OR Logic in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/COUNTIF-with-OR-2.png\" alt=\"3 Simple Methods to Explore the Power of COUNTIF with OR Logic in Excel\" width=\"890\" height=\"490\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/COUNTIF-with-OR-2.png 890w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/COUNTIF-with-OR-2-300x165.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/COUNTIF-with-OR-2-768x423.png 768w\" sizes=\"(max-width: 890px) 100vw, 890px\" \/><\/a><\/p>\n<ul>\n<li><strong>B2:B25<\/strong> specifies the range of cells in which we want to search for matches.<\/li>\n<li><strong>F1:F3<\/strong> specifies the range of cells containing the criteria i.e. Wellington, Waterloo, and Westwood.<\/li>\n<li><strong>COUNTIF<\/strong> function will count the cells that match the 3 criteria individually<\/li>\n<li><strong>SUM<\/strong> function will sum all items in the array and returns the result.<\/li>\n<li>Press<strong> CTRL + SHIFT + Enter<\/strong> to use a array function.<\/li>\n<li>The use of curly brackets &#8220;{ }&#8221; around the formula indicates that it is an <strong>array formula<\/strong>, which allows it to <strong>perform calculations across multiple cells simultaneously<\/strong>.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong><span id=\"3\" style=\"color: #ff0000;\">Count cells using a SUMPRODUCT function<\/span><\/strong><\/p>\n<p>We can even use SUMPRODUCT to count the cells using COUNTIF with OR logic. The formula will be &#8211;<\/p>\n<p><strong>{=SUMPRODUCT(1*(range =criteriarange \u2026))}<\/strong><\/p>\n<p>Let&#8217;s use an example to understand better. In this example, we want to find out how many <strong>competitors are from Wellington, Waterloo, and Westwood. <\/strong>The formula for this using COUNTIF with OR logic will be &#8211;<\/p>\n<p><strong>{=SUMPRODUCT(1*COUNTIF(B2:B25,F1:F3))}<\/strong><\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/COUNTIF-with-OR-3.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-29907\" title=\"3 Simple Methods to Explore the Power of COUNTIF with OR Logic in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/COUNTIF-with-OR-3.png\" alt=\"3 Simple Methods to Explore the Power of COUNTIF with OR Logic in Excel\" width=\"911\" height=\"499\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/COUNTIF-with-OR-3.png 911w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/COUNTIF-with-OR-3-300x164.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/07\/COUNTIF-with-OR-3-768x421.png 768w\" sizes=\"(max-width: 911px) 100vw, 911px\" \/><\/a><\/p>\n<ul>\n<li><strong>COUNTIF(B2:B25,F1:F3)\u00a0<\/strong>&#8211; It will compare each criterion i.e. Wellington, Waterloo, and Westwood with the range B2:B25 and provide TRUE when the criteria match and FALSE otherwise.<\/li>\n<li><strong>1*(range =criteriarange \u2026)\u00a0<\/strong>&#8211; Multiplication sign will convert the TRUEs to 1s and FALSEs to 0s.<\/li>\n<li><strong>SUMPRODUCT<\/strong> function will now add up all the numbers in the array.<\/li>\n<li>Press<strong> CTRL + SHIFT + Enter<\/strong> to use an array function.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #ff0000;\">Conclusion<\/span><\/strong><\/p>\n<p>This article explores different methods of applying the COUNTIF with OR logic, including using the plus sign, SUM function, and SUMPRODUCT function, to efficiently count cells based on multiple criteria in Excel. By utilizing these different techniques, you can effectively count cells based on multiple criteria using COUNTIF with OR logic.<\/p>\n<p>Each method offers its advantages depending on the number of criteria and complexity of the analysis.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Excel is a very versatile and powerful tool used for data analysis, calculation, and manipulation. One of the most used functions is COUNITF in Excel which enables cell counting based on specific conditions. The integration of the COUNTIF with OR operator enhances the function&#8217;s flexibility, making it even more powerful. COUNTIFS can be used when [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":29943,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cos_headline_score":0,"cos_seo_score":0,"cos_headline_text":"","cos_headline_has_been_analyzed":false,"cos_last_analyzed_headline":[],"om_disable_all_campaigns":false},"categories":[325,513],"tags":[1284,1286,1283,1285],"acf":[],"_links":{"self":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/29874"}],"collection":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/comments?post=29874"}],"version-history":[{"count":0,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/29874\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media\/29943"}],"wp:attachment":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media?parent=29874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/categories?post=29874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/tags?post=29874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}