{"id":30744,"date":"2021-02-03T17:20:32","date_gmt":"2021-02-03T16:20:32","guid":{"rendered":"https:\/\/blog.sheetgo.com\/?p=30744"},"modified":"2026-10-23T15:58:39","modified_gmt":"2026-10-23T13:58:39","slug":"funcao-countif-no-excel","status":"publish","type":"post","link":"https:\/\/www.sheetgo.com\/pt\/blog\/excel-functions\/countif-function-in-excel\/","title":{"rendered":"Como usar a fun\u00e7\u00e3o CONT.SE no Excel"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; module_class=&#8221;sheetgo-post&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_row _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>A common task in Excel often involves taking a set of data and tallying the number of occurrences that match certain characteristics. The <a href=\"https:\/\/support.microsoft.com\/en-us\/office\/countif-function-e0de10c6-f885-4e71-abb4-1f464816df34\" target=\"_blank\" rel=\"noopener noreferrer\">COUNTIF Excel function<\/a> allows you to do just that: it counts the number of data points (cells) that meet a certain criteria that you specify within the function.<\/p>\n<p>Because of the wide range of criteria that you can input, the COUNTIF function allows you to filter your data in virtually any way you want.<\/p>\n<p>This guide shows how to use COUNTIF in Excel with text, numbers, cell references, operators, and wildcards, with step-by-step examples. It also covers COUNTIFS, which counts cells that meet several conditions at once, and the errors you&#8217;re most likely to run into.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>COUNTIF vs COUNTIFS: which one do you need?<\/h2>\n<p>Both functions count the cells that meet a condition. The difference is how many conditions they check.<\/p>\n<ul>\n<li><b>COUNTIF<\/b> checks one range against one condition, such as the number of vegetarians in a list.<\/li>\n<li><b>COUNTIFS<\/b> checks one or more ranges, each against its own condition, and counts a row only when every condition is met, such as sales of productA worth $700 or more.<\/li>\n<\/ul>\n<p>Use COUNTIF for a single condition and COUNTIFS when a row has to meet two or more conditions at once. To count rows that meet one condition or another, such as people aged 20 or 21, add two COUNTIF results together, as in the number example below. COUNTIFS has been in Excel since Excel 2007.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>Syntax<\/h2>\n<p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.16&#8243; border_width_left=&#8221;4px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]=COUNTIF(range, criteria)[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<ul>\n<li><b>range<\/b> is the group of cells you wish to count<\/li>\n<li><b>criteria<\/b> is the characteristic that will decide whether or not each cell gets counted. This can be an expression, number, cell reference, or text string.<\/li>\n<\/ul>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>How to use COUNTIF in Excel<\/h2>\n<h3>Criteria as text string<\/h3>\n<p>To illustrate some of the ways that you can use the COUNTIF function in Excel, take a look at the dataset below. It outlines the dietary preferences of a group of people. In the first example, I use COUNTIF to tally the number of vegetarians in the group by typing <b>=COUNTIF(D2:D9,&#8221;Yes&#8221;)<\/b>.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/1.-Countif-text-string.png&#8221; alt=&#8221;Countif Excel \u2014 COUNTIF on the Vegetarian column with Yes as the criterion returns 4&#8243; title_text=&#8221;COUNTIF on the Vegetarian column with Yes as the criterion returns 4&#8243; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>In this example, the criterion that I\u2019ve specified is a text string. The function looks at all the cells in the range that I\u2019ve indicated, and returns the number of cells that match the criteria \u2013 in this case, the number of instances where &#8220;Yes&#8221; appears in the column.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Criteria as cell reference<\/h3>\n<p>Another way of indicating the criteria is to use a cell reference. Take a look at the example below. Here, I count the number of people with allergies by using cell E4 as my criteria. Of course, that cell contains the text string Yes, so this is just an alternative to typing \u201cYes\u201d into the formula.<\/p>\n<p>The formula I use here is <b>=COUNTIF(E2:E9,E4)<\/b>.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/2.-Countif-cell-ref.png&#8221; alt=&#8221;Countif Excel \u2014 COUNTIF with cell E4 as the criterion counts 4 people with allergies&#8221; title_text=&#8221;COUNTIF with cell E4 as the criterion counts 4 people with allergies&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Criteria as a number<\/h3>\n<p>You can also put a number as your criteria in the COUNTIF function. In this example, I want to count only people of a certain age, so I put the age directly into the function.<\/p>\n<p>Notice that unlike a text string,\u00a0 you don\u2019t need to put quotation marks around a number in a formula.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/3.-Countif-number.png&#8221; alt=&#8221;Countif Excel \u2014 two COUNTIF functions added together count 5 people aged 20 and 21&#8243; title_text=&#8221;Two COUNTIF functions added together count 5 people aged 20 and 21&#8243; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>Another thing I&#8217;ve done differently here is: I added two COUNTIF functions together. The reason for this is that I want to count all the people aged 20 and 21.<\/p>\n<p>In order to do this, I use two separate COUNTIF functions. This may sound cumbersome, but the good news is that because COUNTIF just gives a final tally of cells that meet the criteria, you can use multiple COUNTIF functions in the same formula. You simply add them together to get the total count of all cells that match multiple criteria. You can also subtract COUNTIF functions when you want to get cells that are between two criteria.<\/p>\n<p>Adding COUNTIF results like this gives you an OR count: people aged 20 or 21. When every condition has to be true at once, such as people aged 20 who are also vegetarian, use <a href=\"https:\/\/support.microsoft.com\/en-us\/office\/countifs-function-dda3dc6e-f74e-4aee-88bc-aa8c2a866842\" target=\"_blank\" rel=\"noopener noreferrer\">the COUNTIFS function<\/a>, covered further down this guide.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Criteria with logical operator<\/h3>\n<p>Logical operators such as &gt; and &lt; (greater than &amp; less than) can be used within your criteria.<\/p>\n<p>In the example below, I use the &lt; symbol to count all the people younger than 23 in my dataset, by typing <b>=COUNTIF(B2:B9,&#8221;&lt;23&#8243;)<\/b>.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/4.-Countif-logical-operator.png&#8221; alt=&#8221;Countif Excel \u2014 COUNTIF with a less than 23 criterion counts 7 people&#8221; title_text=&#8221;COUNTIF with a less than 23 criterion counts 7 people&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>Note that this criteria includes both the logical operator symbol and a number. The criteria must be enclosed in quotation marks, unlike when you use a number only.<\/p>\n<p>The following logical operators can be used in the same way:<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/5.-Logical-Operators.png&#8221; alt=&#8221;Countif Excel \u2014 table of the six logical operators and what each one means&#8221; title_text=&#8221;Table of the six logical operators and what each one means&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Concatenated criteria<\/h3>\n<p>You\u2019ve now seen the criteria part of the function as a text string, a number, and a cell reference.<\/p>\n<p>Let me show you how to do a combination of these by concatenating (combining) different criteria using the ampersand (&amp;). I do this below by typing <b>=COUNTIF(B2:B9,&#8221;&lt;&#8220;&amp;B7)<\/b>.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/6.-Countif-Concatenate.png&#8221; alt=&#8221;Countif Excel \u2014 the less than sign joined to cell B7 with an ampersand also returns 7&#8243; title_text=&#8221;The less than sign joined to cell B7 with an ampersand also returns 7&#8243; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The result of this function is exactly the same as the previous example.<\/p>\n<p>Except, I have now used the &amp; symbol to concatenate a cell reference (B7) which contains the number 23, instead of simply typing the number 23 into the formula.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Wildcards<\/h3>\n<p>On top of the different ways to set the criteria in the COUNTIF function, there is something else called &#8220;wildcards&#8221;.<\/p>\n<p>The wildcard characters * and ? can be used within your criteria to indicate a match with any character (?) or any sequence of characters (*).<\/p>\n<p>The example below has very specific criteria. I want to count all the occurrences of a 5-letter name that ends in \u201cy\u201d. To do this, you can use the ? wildcard.<\/p>\n<p>This wildcard character is a stand-in for any character \u2013 so when I type <b>=COUNTIF(A2:A9,&#8221;????y&#8221;)<\/b> I indicate that I want to count all instances where there are four characters (which can be anything) followed by a \u201cy\u201d.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/7.-Countif-name-example.png&#8221; alt=&#8221;Countif Excel \u2014 the ????y wildcard counts 2 five-letter names ending in y&#8221; title_text=&#8221;The ????y wildcard counts 2 five-letter names ending in y&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>Use the second wildcard (*) when the length of the criteria doesn\u2019t matter \u2013 for instance, if I didn\u2019t care about the length of the name, just that it ended in \u201cy\u201d, the criteria could be \u201c*y\u201d.<\/p>\n<p>Another handy use for the * wildcard is to get rid of blank cells. I demonstrate that in the screenshot below using the formula <b>=COUNTIF(A2:A13,&#8221;*&#8221;)<\/b>.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/8.-Countif-blank-cells.png&#8221; alt=&#8221;Countif Excel \u2014 the * wildcard counts 8 non-blank cells in A2:A13&#8243; title_text=&#8221;The * wildcard counts 8 non-blank cells in A2:A13&#8243; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>Because the * represents any number of any characters, the only cells that don\u2019t meet this criteria are the ones that don\u2019t contain anything at all!<\/p>\n<p>[\/et_pb_text][et_pb_text module_id=&#8221;countif-criteria-and-operators-in-excel&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>COUNTIF criteria and operators in Excel<\/h2>\n<p>Below, you have some of the most useful operators you can use in your COUNTIF criteria, whether you need to count based on text, numbers, blanks &amp; non-blanks, or Boolean values.<\/p>\n<h3>Text values<\/h3>\n<p>When it comes to matching text values, you have a lot of options. For an exact match, just enclose the string in quotation marks or the reference to the cell containing the string. For partial matches, you can use the wildcard characters below.<\/p>\n<ul>\n<li><strong>*<\/strong> Matches 0 or more characters.<\/li>\n<li><strong>?<\/strong> Matches a single character.<\/li>\n<li><strong>~<\/strong> If you need to search for the symbols \u201c*\u201d or \u201c?\u201d, add the tilde before the symbol to escape it, so it&#8217;s not used as a wildcard.<\/li>\n<\/ul>\n<p>Finally, the function is case insensitive, so it won\u2019t distinguish between uppercase and lowercase.<\/p>\n<h3>Numbers and dates<\/h3>\n<p>If you want to use an exact numeric value as the criterion, you don\u2019t need to enclose it in quotation marks. However, if you want to use comparison operators, you need to enclose the criterion in quotation marks.<\/p>\n<ul>\n<li><strong>&lt;&gt;<\/strong> not equal<\/li>\n<li><strong>=<\/strong> equal<\/li>\n<li><strong>&gt;=<\/strong> greater than or equal<\/li>\n<li><strong>&lt;=<\/strong> less than or equal<\/li>\n<li><strong>&gt;<\/strong> greater than<\/li>\n<li><strong>&lt;<\/strong> less than<\/li>\n<\/ul>\n<p>Dates work the same way, because Excel stores them as numbers. For example, =COUNTIF(B2:B100,&quot;&gt;=&quot;&amp;DATE(2026,1,1)) counts the dates on or after January 1, 2026.<\/p>\n<h3>Blank and non-blank cells<\/h3>\n<p>Use these criteria to count blank and non-blank cells.<\/p>\n<ul>\n<li><strong>&quot;&quot;<\/strong> (two quotation marks with nothing between them) counts blank cells, as in =COUNTIF(A2:A13,&quot;&quot;).<\/li>\n<li><strong>&quot;&lt;&gt;&quot;<\/strong> counts cells that aren&#8217;t blank, as in =COUNTIF(A2:A13,&quot;&lt;&gt;&quot;).<\/li>\n<\/ul>\n<p>The * wildcard from the wildcards example also skips blank cells, but it only counts cells that hold text, so it leaves numbers out.<\/p>\n<h3>TRUE and FALSE values<\/h3>\n<p>Finally, you can also use the Boolean operators TRUE and FALSE to count cells based on the results of a formula or to count checked or unchecked checkboxes. For example, =COUNTIF(E2:E20,TRUE) counts the checked boxes in E2:E20.<\/p>\n<p>[\/et_pb_text][et_pb_text module_id=&#8221;countif-examples-in-excel-step-by-step&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>COUNTIF examples in Excel, step by step<\/h2>\n<p>Now that you have reviewed the syntax for the COUNTIF function, it\u2019s time to see some examples of how you can use it in different situations.<\/p>\n<p>Imagine you have an Excel table with sales data, which includes the name of the sales agent, their team, the product, and the sales amount. You need to get different counts for your sales report, but counting manually would be a nightmare, as the table has five hundred rows.<\/p>\n<p>First, select each column and go to the \u2018Formulas\u2019 tab. Click \u2018Create from Selection\u2019 to name the ranges so it&#8217;s easier to work with the data.<\/p>\n<p>The screenshots come from Excel set to European regional settings, so they show semicolons between arguments. In the US and UK versions of Excel, you type commas, as in the steps below.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countif-excel-name-manager-named-ranges.webp&#8221; alt=&#8221;COUNTIF in Excel \u2014 Name Manager listing the named ranges product, sales_agent, sales_amount, sales_data and sales_team&#8221; title_text=&#8221;Name Manager listing the named ranges product, sales_agent, sales_amount, sales_data and sales_team&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Count cells that contain exact text<\/h3>\n<p>Follow the steps below to count cells that contain specific text. In this case, let&#8217;s count the number of sales by \u2018Barret Smitten\u2019.<\/p>\n<p><strong>1.<\/strong> Type the COUNTIF function and select the range of cells you want to count. In this case, I will use the named range \u2018sales_agent\u2019.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countif-excel-exact-text-range.webp&#8221; alt=&#8221;COUNTIF in Excel \u2014 COUNTIF typed in F2 with the sales_agent range selected&#8221; title_text=&#8221;COUNTIF typed in F2 with the sales_agent range selected&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>2.<\/strong> Add a comma and type the criterion between quotation marks.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countif-excel-exact-text-criterion.webp&#8221; alt=&#8221;COUNTIF in Excel \u2014 Barret Smitten typed in quotation marks as the criterion&#8221; title_text=&#8221;Barret Smitten typed in quotation marks as the criterion&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>3.<\/strong> Add the closing parenthesis and press \u2018Enter\u2019 to see the result.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countif-excel-exact-text-result.webp&#8221; alt=&#8221;COUNTIF in Excel \u2014 21 sales by Barret Smitten in F2&#8243; title_text=&#8221;21 sales by Barret Smitten in F2&#8243; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The finished formula is <b>=COUNTIF(sales_agent,&#8221;Barret Smitten&#8221;)<\/b>, and it returns 21.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Count cells that contain partial text<\/h3>\n<p>Instead of using an exact match, you can use wildcards to search for part of the text. For example, let\u2019s count the number of sales made by \u2018Northteam\u2019 by matching \u2018North\u2019.<\/p>\n<p><strong>1.<\/strong> Type the COUNTIF function and select the range of cells you want to count.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countif-excel-partial-text-range.webp&#8221; alt=&#8221;COUNTIF in Excel \u2014 COUNTIF typed in F5 with the sales_team range selected&#8221; title_text=&#8221;COUNTIF typed in F5 with the sales_team range selected&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>2.<\/strong> Add a comma and type the criterion between quotation marks.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countif-excel-partial-text-criterion.webp&#8221; alt=&#8221;COUNTIF in Excel \u2014 North* wildcard criterion in quotation marks&#8221; title_text=&#8221;North* wildcard criterion in quotation marks&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>3.<\/strong> Add the closing parenthesis and press \u2018Enter\u2019 to see the result.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countif-excel-partial-text-result.webp&#8221; alt=&#8221;COUNTIF in Excel \u2014 189 sales by Northteam in F5&#8243; title_text=&#8221;189 sales by Northteam in F5&#8243; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The finished formula is <b>=COUNTIF(sales_team,&#8221;North*&#8221;)<\/b>, and it returns 189.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Count values greater than or equal to a number<\/h3>\n<p>For this example, let\u2019s find the number of sales for an amount greater than or equal to $500.<\/p>\n<p><strong>1.<\/strong> Type the COUNTIF function and select the range of cells you want to count.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countif-excel-greater-than-range.webp&#8221; alt=&#8221;COUNTIF in Excel \u2014 COUNTIF typed in F8 with the sales_amount range selected&#8221; title_text=&#8221;COUNTIF typed in F8 with the sales_amount range selected&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>2.<\/strong> Add a comma and type the criterion between quotation marks.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countif-excel-greater-than-criterion.webp&#8221; alt=&#8221;COUNTIF in Excel \u2014 greater than or equal to 500 typed as the criterion&#8221; title_text=&#8221;Greater than or equal to 500 typed as the criterion&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>3.<\/strong> Add the closing parenthesis and press \u2018Enter\u2019 to see the result.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countif-excel-greater-than-result.webp&#8221; alt=&#8221;COUNTIF in Excel \u2014 412 sales of $500 or more in F8&#8243; title_text=&#8221;412 sales of $500 or more in F8&#8243; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The finished formula is <b>=COUNTIF(sales_amount,&#8221;&gt;=500&#8243;)<\/b>, and it returns 412.<\/p>\n<p>[\/et_pb_text][et_pb_text module_id=&#8221;how-to-use-countifs-in-excel-with-multip&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>How to use COUNTIFS in Excel with multiple criteria<\/h2>\n<p>In Microsoft Excel, you can use the COUNTIFS function to count cells based on multiple criteria, and each criterion can be applied to one or more ranges.<\/p>\n<h3>COUNTIFS syntax<\/h3>\n<p><b>=COUNTIFS(criteria_range1, criterion1, criteria_range2, criterion2, &#8230;)<\/b><\/p>\n<p>Like COUNTIF, the COUNTIFS function has two required parameters. However, you can provide additional parameters to test multiple ranges using different criteria. Remember that all ranges must have the same dimensions, meaning the same number of rows and columns.<\/p>\n<ul>\n<li><strong>criteria_range1:<\/strong> the range of cells you want to test using the first criterion.<\/li>\n<li><strong>criterion1:<\/strong> the condition or test that you want to apply to the first range.<\/li>\n<li><strong>criteria_range2, criterion2, &#8230;:<\/strong> optional pairs. Add as many as you need. COUNTIFS counts a row only when it meets every criterion.<\/li>\n<\/ul>\n<p>The examples below use the same sales table as the COUNTIF examples.<\/p>\n<h3>COUNTIFS with two criteria on one range<\/h3>\n<p>For example, let&#8217;s count the sales above $600 and below $1,000. The label in the screenshots says $500, but the formula and its result use $600.<\/p>\n<p><strong>1.<\/strong> Type the COUNTIFS function and select the range of cells you want to count.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countifs-excel-one-range-first-range.webp&#8221; alt=&#8221;COUNTIFS in Excel \u2014 COUNTIFS typed in F2 with the sales_amount range selected&#8221; title_text=&#8221;COUNTIFS typed in F2 with the sales_amount range selected&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>2.<\/strong> Add a comma and type the first criterion between quotation marks.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countifs-excel-one-range-first-criterion.webp&#8221; alt=&#8221;COUNTIFS in Excel \u2014 greater than 600 typed as the first criterion&#8221; title_text=&#8221;Greater than 600 typed as the first criterion&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>3.<\/strong> Add a comma and select the same range as before. Add another comma and type the second criterion between quotation marks.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countifs-excel-one-range-second-criterion.webp&#8221; alt=&#8221;COUNTIFS in Excel \u2014 sales_amount selected again with less than 1000 as the second criterion&#8221; title_text=&#8221;Sales_amount selected again with less than 1000 as the second criterion&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>4.<\/strong> Add the closing parenthesis and press \u2018Enter\u2019 to see the result.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countifs-excel-one-range-result.webp&#8221; alt=&#8221;COUNTIFS in Excel \u2014 103 sales above $600 and below $1,000 in F2&#8243; title_text=&#8221;103 sales above $600 and below $1,000 in F2&#8243; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The finished formula is <b>=COUNTIFS(sales_amount,&#8221;&gt;600&#8243;,sales_amount,&#8221;&lt;1000&#8243;)<\/b>, and it returns 103.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>COUNTIFS with criteria on different ranges<\/h3>\n<p>Finally, let\u2019s count the number of sales of productA for an amount greater than or equal to $700.<\/p>\n<p><strong>1.<\/strong> Type the COUNTIFS function and select the first range of cells.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countifs-excel-two-ranges-first-range.webp&#8221; alt=&#8221;COUNTIFS in Excel \u2014 COUNTIFS typed in F5 with the product range selected&#8221; title_text=&#8221;COUNTIFS typed in F5 with the product range selected&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>2.<\/strong> Add a comma and type the first criterion between quotation marks.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countifs-excel-two-ranges-first-criterion.webp&#8221; alt=&#8221;COUNTIFS in Excel \u2014 productA typed in quotation marks as the first criterion&#8221; title_text=&#8221;ProductA typed in quotation marks as the first criterion&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>3.<\/strong> Add a comma and select the second range of cells. Add another comma and type the second criterion between quotation marks.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countifs-excel-two-ranges-second-criterion.webp&#8221; alt=&#8221;COUNTIFS in Excel \u2014 sales_amount range with greater than or equal to 700 as the second criterion&#8221; title_text=&#8221;Sales_amount range with greater than or equal to 700 as the second criterion&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>4.<\/strong> Add the closing parenthesis and press \u2018Enter\u2019 to see the result.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/countifs-excel-two-ranges-result.webp&#8221; alt=&#8221;COUNTIFS in Excel \u2014 80 productA sales of $700 or more in F5&#8243; title_text=&#8221;80 productA sales of $700 or more in F5&#8243; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The finished formula is <b>=COUNTIFS(product,&#8221;productA&#8221;,sales_amount,&#8221;&gt;=700&#8243;)<\/b>, and it returns 80.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>Common COUNTIF and COUNTIFS errors and how to fix them<\/h2>\n<ul>\n<li><b>Excel says there&#8217;s a problem with the formula.<\/b> Check the separator between arguments. Excel uses commas in the US and UK, and semicolons in regions where the comma is the decimal mark. Also check that every text criterion has quotation marks on both sides.<\/li>\n<li><b>An operator returns an error.<\/b> The operator goes inside the quotation marks with the number, as in &quot;&lt;23&quot;. To compare with a cell, join the operator to the cell reference with an ampersand: &quot;&lt;&quot;&amp;B7.<\/li>\n<li><b>Text that looks the same isn&#8217;t counted.<\/b> A trailing space is enough to stop an exact match, so &quot;Barret Smitten &quot; and &quot;Barret Smitten&quot; count as different text. Remove the spaces with TRIM, or end the criterion with the * wildcard.<\/li>\n<li><b>COUNTIFS returns #VALUE!.<\/b> Every criteria range has to be the same size. A2:A100 and B2:B90 don&#8217;t match, so make all the ranges start and end on the same rows.<\/li>\n<li><b>#VALUE! when the range is in another workbook.<\/b> COUNTIF and COUNTIFS can&#8217;t read a workbook that&#8217;s closed. Open it and the formula recalculates.<\/li>\n<li><b>Wrong results with long text.<\/b> COUNTIF can&#8217;t match text longer than 255 characters. Split the criterion in two and join the halves with &amp;, as in &quot;first part&quot;&amp;&quot;second part&quot;.<\/li>\n<\/ul>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>That&#8217;s how to use COUNTIF and COUNTIFS in Excel<\/h2>\n<p>By now, you hopefully have a good grasp on the many ways the Excel COUNTIF and COUNTIFS functions can be used, and can put them into practice with your own data. Happy counting!<\/p>\n<p>To add up values instead of counting them, see <a href=\"https:\/\/www.sheetgo.com\/blog\/excel-functions\/sumif-excel\/\">how to use SUMIF in Excel<\/a>. To find a value in a table, read our guide to <a href=\"https:\/\/www.sheetgo.com\/blog\/excel-functions\/vlookup-excel\/\">VLOOKUP in Excel<\/a>, and for more formulas worth knowing, see the <a href=\"https:\/\/www.sheetgo.com\/blog\/excel-functions\/top-10-excel-functions\/\">top 10 Excel functions<\/a>.<\/p>\n<p>If you work in Google Sheets, see <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/countifs-in-google-sheets\/\">how to use COUNTIFS in Google Sheets<\/a> and our blog post on the <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/dcount-formula-google-sheets\/\" target=\"_blank\" rel=\"noopener\">DCOUNT formula in Google Sheets<\/a>.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A common task in Excel often involves taking a set of data and tallying the number of occurrences that match certain characteristics. The COUNTIF Excel function allows you to do just that: it counts the number of data points (cells) that meet a certain criteria that you specify within the function. Because of the wide [&hellip;]<\/p>\n","protected":false},"author":40,"featured_media":30746,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[65],"tags":[39,48,28],"class_list":["post-30744","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-excel-functions","tag-connections-t","tag-excel","tag-spreadsheets"],"acf":[],"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/30744","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/comments?post=30744"}],"version-history":[{"count":0,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/30744\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media\/30746"}],"wp:attachment":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media?parent=30744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/categories?post=30744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/tags?post=30744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}