

Or by replacing it with a cell reference: We can count the number of occurrences of the number "125" by indicating the number itself as a second argument: Of course, we can do the same thing with numerical values. As you can see, it's a lot easier now to edit the formula and its searching criteria. The function uses the content of A3 (the text value "West") in its calculations. Let's count the number of occurred sales in the "West" region using the cell reference in COUNTIF. The better decision would be to write the criteria down other Google Sheets cell and reference that cell in the formula. You may have noticed that it's not really convenient to set the searching criteria in the formula - you have to edit it every time. =COUNTIF(D6,"Milk Chocolate") + COUNTIF(D8,"Milk Chocolate") + COUNTIF(D10,"Milk Chocolate") + COUNTIF(D12,"Milk Chocolate") + COUNTIF(D14,"Milk Chocolate") In other words, you can't indicate a few separate cells or columns and rows.

COUNTIF function works with a single cell or neighboring columns. Remember to finish the function with a closing bracket ")" and press "Enter".Īlso, don't forget to enter double quotes ("") when using text values.Īs a result, we get three sales of this type of chocolate. In our case it's going to be the text - "Milk Chocolate". The second argument is a value that we're going to look for across the selected range. Then enter a comma (,) and specify the second argument - searching criteria. By the way, you don't have to enter the range manually - mouse selection is enough. The first argument of COUNTIF is represented by the following range: D6:D16. As soon as you type the letter "C", it will prompt you to choose a function that begins with this letter. Google Sheets immediately understands that we are going to enter a formula. Place the cursor in the cell where you want to get the result and enter the equality sign (=). We need to count the number of "Milk Chocolate" sold. This is how your sales data look like in Google Sheets: Let's suppose your company sells various types of chocolate in several consumer regions and works with many clients. Google Spreadsheet COUNTIF for text and numbers (exact match) It's high time to try and build a formula together. The thing is that we can decide to look for not only concrete values but also those that meet certain criteria. Its searching criteria alone is enough to earn such a description. It may seem that COUNTIF is so simple that it doesn't even count as a function (pun intended), but in truth its potential is quite impressive.

It's time to pick up some knowledge on how COUNTIF is used in Google Spreadsheet and learn why this function makes a true Google Spreadsheet companion. Google Sheets COUNTIF is one of the easiest functions to learn and one of the handiest to use.
