# Excel Function : COUNTIFS

## Excel Function : COUNTIFS

Statistical

###### Description

Counts the number of cells within a range that meet multiple criteria

## Syntax and Description of the COUNTIFS Excel Function

I get a syntax error when trying to use the COUNTIFS function. I'm trying to use COUNTIFS to count how many cells in the column contains `1` and `2` at the same time. ```=COUNTIFS(A1:A20,"1",A1:A20,"2") ``` The above code gives me a syntax error. A: You can only use a single criteria in COUNTIFS, so you'll need to combine your criteria with an "OR" function. `=COUNTIFS(A1:A20, "1 `

``` About COUNTIFS Excel Function The COUNTIFS function in Excel counts the number of cells that meet multiple criteria. The syntax for the COUNTIFS function is as follows: =COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...) where criteria_range1 is the first range of cells to be evaluated for the criteria1, criteria1 is the criterion that cells in criteria_range1 must meet, criteria_range2 is the second range of cells to be evaluated for the criteria2, and criteria2 is the criterion that cells in criteria_range2 must meet. Additional criteria_range/criteria pairs can be added as ```
``` FacebookTwitterPinterestLinkedIn ```
``` ```
``` Other Excel Functions NPER STDEV UPPER GAMMALN.PRECISE RANK.AVG You may also like Free Excel to JSON Converter Import/Convert XML to Excel 2 ways to Convert XLSX to XLS 2 ways to Import/Convert TXT File to Excel File Excel Macro not working : The solution is here! ```
``` Free Excel Macros, Templates…FACEBOOK Macros In Excel eXcelMacro App on Google Play Categories Add ins2 Excel with Examples7 Free Excel Macro1 Macros12 VBA Codes1 Recent Posts Free Excel to JSON Converter Import/Convert XML to Excel 2 ways to Convert XLSX to XLS 2 ways to Import/Convert TXT File to Excel File MacrosInExcel YouTube Channel https://youtu.be/iuUX6wENyDw ```
``` About Contact Privacy Policy Terms of Use Facebook Twitter Pinterest Tumblr Linkedin Copyright © 2022. ```
``` ```
``` /* <![CDATA[ */ var wpcf7 = {"api":{"root":"https:\/\/www.macrosinexcel.com\/wp-json\/","namespace":"contact-form-7\/v1"},"cached":"1"}; /* ]]> */ /* <![CDATA[ */ var vce_js_settings = {"sticky_header":"1","sticky_header_offset":"700","sticky_header_logo":"","logo":"https:\/\/www.macrosinexcel.com\/wp-content\/uploads\/2019\/11\/logo-3.png","logo_retina":"","logo_mobile":"https:\/\/www.macrosinexcel.com\/wp-content\/uploads\/2019\/11\/logo-3.png","logo_mobile_retina":"","rtl_mode":"0","ajax_url":"https:\/\/www.macrosinexcel.com\/wp-admin\/admin-ajax.php","ajax_wpml_current_lang":null,"ajax_mega_menu":"1","mega_menu_slider":"","mega_menu_subcats":"","lay_fa_grid_center":"","full_slider_autoplay":"","grid_slider_autoplay":"","grid_big_slider_autoplay":"","fa_big_opacity":{"1":"0.5","2":"0.7"},"top_bar_mobile":"0","top_bar_mobile_group":"","top_bar_more_link":"More"}; /* ]]> */ if ( typeof window.ASP == 'undefined') { window.ASP = {wp_rocket_exception: "DOMContentLoaded", ajaxurl: "https:\/\/www.macrosinexcel.com\/wp-admin\/admin-ajax.php", backend_ajaxurl: "https:\/\/www.macrosinexcel.com\/wp-admin\/admin-ajax.php", js_scope: "jQuery", asp_url: "https:\/\/www.macrosinexcel.com\/wp-content\/plugins\/ajax-search-pro\/", upload_url: "https:\/\/www.macrosinexcel.com\/wp-content\/uploads\/asp_upload\/", css_basic_url: "https:\/\/www.macrosinexcel.com\/wp-content\/uploads\/asp_upload\/style.basic-ho-is-po-no-da-co-au-ga-se-is.css", detect_ajax: 0, media_query: "e5G3bH", version: 5034, pageHTML: "", additional_scripts: [{"handle":"wd-asp-scroll-simple","src":"https:\/\/www.macrosinexcel.com\/wp-content\/plugins\/ajax-search-pro\/js\/min\/external\/simplebar.js","prereq":false},{"handle":"wd-asp-ajaxsearchpro","src":"https:\/\/www.macrosinexcel.com\/wp-content\/plugins\/ajax-search-pro\/js\/min\/plugin\/optimized\/asp-prereq.js","prereq":[]},{"handle":"wd-asp-ajaxsearchpro-core","src":"https:\/\/www.macrosinexcel.com\/wp-content\/plugins\/ajax-search-pro\/js\/min\/plugin\/optimized\/asp-core.js","prereq":[]},{"handle":"wd-asp-ajaxsearchpro-settings","src":"https:\/\/www.macrosinexcel.com\/wp-content\/plugins\/ajax-search-pro\/js\/min\/plugin\/optimized\/asp-settings.js","prereq":["wd-asp-ajaxsearchpro"]},{"handle":"wd-asp-ajaxsearchpro-vertical","src":"https:\/\/www.macrosinexcel.com\/wp-content\/plugins\/ajax-search-pro\/js\/min\/plugin\/optimized\/asp-results-vertical.js","prereq":["wd-asp-ajaxsearchpro"]},{"handle":"wd-asp-ajaxsearchpro-live","src":"https:\/\/www.macrosinexcel.com\/wp-content\/plugins\/ajax-search-pro\/js\/min\/plugin\/optimized\/asp-live.js","prereq":["wd-asp-ajaxsearchpro"]},{"handle":"wd-asp-ajaxsearchpro-autocomplete","src":"https:\/\/www.macrosinexcel.com\/wp-content\/plugins\/ajax-search-pro\/js\/min\/plugin\/optimized\/asp-autocomplete.js","prereq":["wd-asp-ajaxsearchpro"]},{"handle":"wd-asp-ajaxsearchpro-load","src":"https:\/\/www.macrosinexcel.com\/wp-content\/plugins\/ajax-search-pro\/js\/min\/plugin\/optimized\/asp-load.js","prereq":["wd-asp-ajaxsearchpro-autocomplete"]}], script_async_load: false, init_only_in_viewport: true, scrollbar: true, css_async: false, highlight: {"enabled":false,"data":[]}, debug: false, instances: {}, analytics: {"method":0,"tracking_id":"","string":"?ajax_search={asp_term}","event":{"focus":{"active":1,"action":"focus","category":"ASP {search_id} | {search_name}","label":"Input focus","value":"1"},"search_start":{"active":0,"action":"search_start","category":"ASP {search_id} | {search_name}","label":"Phrase: {phrase}","value":"1"},"search_end":{"active":1,"action":"search_end","category":"ASP {search_id} | {search_name}","label":"{phrase} | {results_count}","value":"1"},"magnifier":{"active":1,"action":"magnifier","category":"ASP {search_id} | {search_name}","label":"Magnifier clicked","value":"1"},"return":{"active":1,"action":"return","category":"ASP {search_id} | {search_name}","label":"Return button pressed","value":"1"},"try_this":{"active":1,"action":"try_this","category":"ASP {search_id} | {search_name}","label":"Try this click | {phrase}","value":"1"},"facet_change":{"active":0,"action":"facet_change","category":"ASP {search_id} | {search_name}","label":"{option_label} | {option_value}","value":"1"},"result_click":{"active":1,"action":"result_click","category":"ASP {search_id} | {search_name}","label":"{result_title} | {result_url}","value":"1"}}}}}; var mejsL10n = {"language":"en","strings":{"mejs.download-file":"Download File","mejs.install-flash":"You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https:\/\/get.adobe.com\/flashplayer\/","mejs.fullscreen":"Fullscreen","mejs.play":"Play","mejs.pause":"Pause","mejs.time-slider":"Time Slider","mejs.time-help-text":"Use Left\/Right Arrow keys to advance one second, Up\/Down arrows to advance ten seconds.","mejs.live-broadcast":"Live Broadcast","mejs.volume-help-text":"Use Up\/Down Arrow keys to increase or decrease volume.","mejs.unmute":"Unmute","mejs.mute":"Mute","mejs.volume-slider":"Volume Slider","mejs.video-player":"Video Player","mejs.audio-player":"Audio Player","mejs.captions-subtitles":"Captions\/Subtitles","mejs.captions-chapters":"Chapters","mejs.none":"None","mejs.afrikaans":"Afrikaans","mejs.albanian":"Albanian","mejs.arabic":"Arabic","mejs.belarusian":"Belarusian","mejs.bulgarian":"Bulgarian","mejs.catalan":"Catalan","mejs.chinese":"Chinese","mejs.chinese-simplified":"Chinese (Simplified)","mejs.chinese-traditional":"Chinese (Traditional)","mejs.croatian":"Croatian","mejs.czech":"Czech","mejs.danish":"Danish","mejs.dutch":"Dutch","mejs.english":"English","mejs.estonian":"Estonian","mejs.filipino":"Filipino","mejs.finnish":"Finnish","mejs.french":"French","mejs.galician":"Galician","mejs.german":"German","mejs.greek":"Greek","mejs.haitian-creole":"Haitian Creole","mejs.hebrew":"Hebrew","mejs.hindi":"Hindi","mejs.hungarian":"Hungarian","mejs.icelandic":"Icelandic","mejs.indonesian":"Indonesian","mejs.irish":"Irish","mejs.italian":"Italian","mejs.japanese":"Japanese","mejs.korean":"Korean","mejs.latvian":"Latvian","mejs.lithuanian":"Lithuanian","mejs.macedonian":"Macedonian","mejs.malay":"Malay","mejs.maltese":"Maltese","mejs.norwegian":"Norwegian","mejs.persian":"Persian","mejs.polish":"Polish","mejs.portuguese":"Portuguese","mejs.romanian":"Romanian","mejs.russian":"Russian","mejs.serbian":"Serbian","mejs.slovak":"Slovak","mejs.slovenian":"Slovenian","mejs.spanish":"Spanish","mejs.swahili":"Swahili","mejs.swedish":"Swedish","mejs.tagalog":"Tagalog","mejs.thai":"Thai","mejs.turkish":"Turkish","mejs.ukrainian":"Ukrainian","mejs.vietnamese":"Vietnamese","mejs.welsh":"Welsh","mejs.yiddish":"Yiddish"}}; /* <![CDATA[ */ var _wpmejsSettings = {"pluginPath":"\/wp-includes\/js\/mediaelement\/","classPrefix":"mejs-","stretching":"responsive"}; /* ]]> */ /* <![CDATA[ */if ( !!window.jQuery ) {(function(\$){\$(document).ready(function(){if ( !!window.SLB ) { {\$.extend(SLB, {"context":["public","user_guest"]});} }})})(jQuery);}/* ]]> */ ```