fbpx
COUNTIF Function

COUNTIF Function in Excel | Use of COUNTIF in Excel

Table of Contents

Excel में COUNTIF Function को statistical function की category में रखा गया है। यह Function किसी perticular criteria के आधार पर Data Range में cells को count करने के लिए Use किया जाता है।

अगर आपने count Function से Related मेरी पिछली Post नहीं पढ़ी तो नीचे दिए गए Link पर Click करके पढ़े –

COUNT ,COUNTA ,COUNTBLANK Function in excel hindi

COUNTIF Function syntax-

=COUNTIF(range, criteria)

Arguments-

range- इस Arguments में हम वो Range Define करते है जिसके अंदर Cells को count करना है, criteria के आधार पर।

criteria- यहाँ हम एक Condition देते है जिसके आधार पर Cell को count किया जाता है।

Note- COUNTIF Function में हम सिर्फ एक ही criteria Define कर सकते है।

COUNTIF With Text Criteria

countif function को text criteria के साथ कैसे Use करते है इसे समझने के लिए एक Data ले। जैसा कि नीचे Image में दिखाया गया है।

 

COUNTIF function in excel | Use of COUNTIF in excel in hindi

 

 

इस Data में हमे यह count करना है कि “Sumit” Name कितनी बार repeat हुआ है।

इसके लिए सबसे पहले Cell को Select करे जहां आप Formula लगाना चाहते है। हमने यहाँ Cell C2 को Select किया है।

अब COUNTIF function का Use कुछ इस प्रकार करेंगे –

=COUNTIF(A2:A8,”sumit”)

Note- COUNTIF Function एक case-insensitive function होता है जिसका मतलब है कि यह upper-case और lower-case में अंतर नहीं कर सकता।

 

COUNTIF function in excel | Use of COUNTIF in excel in hindi

 

 

Formula लगाने के बाद enter key Press करे। enter करते ही हमे यह Value “3” return करेगा।

Formula को समझे –

 

COUNTIF function in excel | Use of COUNTIF in excel in hindi

range- यह पहला Argument है जिसमे हमने Cell Range A2 से A8 तक Select किया है जिसमे हमारा criteria “sumit” मौजूद है।

 

criteria- यह दूसरा Arguments है जिसमे हमने criteria “sumit” को Define किया है।

COUNTIF function इसी criteria को दिए गए Range में Search करके count करता है।

COUNTIF With Date Range

Countif function के साथ date range को Use करने के लिए हमने यहाँ एक Data लिया है। इस Data में retired employee के Name और dates दिए गए है।

इस Data में हमे यह पता करना है कि “4-jan-2018” को कितने employees retire हुए है।

इसके लिए हमने Cell में Formula =COUNTIF(A2:A12,”4-jan-2018″) लगाया है।

 

COUNTIF function in excel | countif with date range

Formula-

=COUNTIF(A2:A12,”4-jan-2018″)
result- 4
 

यहाँ countif function के पहले आर्गुमेंट में हमने date रेंज A2 से A12 तक सेलेक्ट किया है।

दूसरे आर्गुमेंट में डेट criteria “4-jan-2018” double quotation mark में दिया गया है।

countif function दिए हुए criteria (4-jan-2018) को डाटा रेंज में सर्च करेगा और इसे count करके total value return करेगा।

COUNTIF With VLOOKUP Function

Countif function और Vlookup function को एक साथ Use करके, हम किस प्रकार एक Powerful Formula बना सकते है आईये समझते है।

यहाँ हमने Excel Sheet में दो अलग -अलग Data लिया है – “Product details” और “Customer details”…

 

COUNTIF function in excel | countif with vlookup function

 

Product details में कुछ Product की List और उनकी id दी गयी है। जबकि Customer details में Customer के Name ,Customer id और उनके द्वारा Purchase किए गए Product की id को दिखाया गया है।

Question-

आप नीचे Image में देख सकते है कि हमने पहले से Cell D12 में Product की Drop Down List बनायीं है।

इस Drop Down List List से select किये गए Product को कितनी बार Purchase किया गया है, यह हमे countif function द्वारा पता करना है। तो चलिए Start करते है –

 

COUNTIF function in excel | countif with vlookup function

 

Answer-

 
सबसे पहले आप Product की Drop Down List बनाये। आप चाहे तो direct product name भी Type कर सकते है।
यहाँ हमने product name “shampoo” Select किया है।
अब वह Cell Select करे जहां आप Formula लगाना चाहते है।
Cell Select करने के बाद उसमे Formula =COUNTIF(F3:F6,VLOOKUP(D12,A3:B9,2,0)) Type करे और ctrl+ shift+ enter करे।
COUNTIF function in excel | countif with vlookup function

यह हमे “3” Result के रूप में return करता है। आप ऊपर Image में देख सकते है कि “shampoo” जिसकी id “2002” है उसे तीन बार Purchase किया गया है।

Formula को समझे –

COUNTIF function in excel | countif with vlookup function

इस Formula के पहले Arguments में हमने customer details में दिए गए product id को Select किया है जो कि Range F3 से F6 तक है।

दूसरे Arguments में हमने vlookup function का Use किया है। vlookup function Cell D12 में Select किये गए Product (shampoo) की id को Search करेगा।

=COUNTIF(F3:F6, 2002)

अब यह product id (2002) countif function के लिए criteria के रूप में Use होगा।

इस प्रकार countif function इस id (2002) को Range F3:F6 में Count करके हमे Result display करेगा।

result – 3

COUNTIF With Wildcard Character

अब हम जानेंगे कि countif function में wildcard characters का Use कैसे करते है। पर इससे पहले यह जाने कि wildcard characters क्या है ?

wildcard तीन प्रकार के होते है – *(asterisk), ?(question mark), ~(Tilde)

wildcard characters का Use तब किया जाता है जब हम criteria के बारे में पूरी तरह निश्चित नहीं होते।

आईये इसे Example के द्वारा समझे  –

Example (1)

माना कि हमारे पास एक Data है जिसमे हमे उन सभी Names को Count करना है जिनके Name में “sh” character मौजूद है।

इसके लिए हम Cell में Formula =COUNTIF(A2:A8,”*sh*”) लगाएंगे।

 

countif with wildcard, countif with asterisk

Formula लगाने के बाद जैसे हम enter करेंगे यह हमे “3” return करेगा। आप ऊपर Image में देख सकते है कि Data में तीन ऐसे Name है जिनमे “sh” character है।

हमने *sh* के Starting और Last में *(asterisk) का use किया है जिसका मतलब है कि COUNTIF function उन सभी Names को count करेगा जिनमे “sh” word मौजूद है (चाहे वह Start में हो , Mid में या फिर Last में )

Note-

A*-  “A” character से Start होने वाले words.

*A-  ऐसे words जिनके Last में A हो।

Example (2)

इस Example में हमने Data से उन लोगो के Name count किये है जिनके Name में 6 character है।

इसके लिए हम Formula कुछ इस तरह Use करेंगे-

=COUNTIF(A2:A8,”??????”)

result – 2

Note- “?” एक Single character को Show करता है। इसलिए हमने Formula में 6 बार question mark (??????) का Use किया है।

 

countif with wildcard characters

आप ऊपर Image में देख सकते है कि Data में सिर्फ दो ही ऐसे Name है जिनमे 6 character है।

Leave a Comment

Your email address will not be published. Required fields are marked *

error: Content is protected !!
%d bloggers like this: