Excel COUNTIF iyo COUNTIFS oo leh AMA macquul ah

  • La Wadaag Tan
Michael Brown

Tababarku wuxuu sharxayaa sida loo isticmaalo Excel's COUNTIF iyo COUNTIFS si loo tiriyo unugyada leh xaalado AMA badan, tusaale. haddii unuggu ka kooban yahay X, Y ama Z.

Sida qof kastaa og yahay, shaqada Excel COUNTIF waxaa loogu talagalay in lagu tiriyo unugyo iyadoo lagu saleynayo hal shuruud oo keliya halka COUNTIFS ay ku qiimayso shuruudo badan oo leh AND macquul ah. Laakiin ka waran haddii hawshaadu u baahan tahay AMA macquul ah - marka shuruudo dhowr ah la bixiyo, qof kastaa wuu la mid noqon karaa in lagu daro tirinta?

faahfaahin buuxda. Tusaalooyinka ayaa tilmaamaya in aad aqoon fiican u leedahay hab-raacyada iyo isticmaalka guud ee labada hawlood. Haddii kale, waxaa laga yaabaa inaad rabto inaad ku bilowdo dib u eegista aasaasiga ah:

Shaqada Excel COUNTIF - waxay tirisaa unugyo leh hal shuruud. 0>Hadda oo qof kastaa ku yaal isla bogga, aan ku quusno:

    Tiri unugyada leh AMA xaaladaha Excel

    Qaybtani waxay dabooshaa muuqaalka ugu fudud - tirinta unugyada buuxi mid kasta (ugu yaraan hal) shuruudaha la cayimay.

    Formula 1. COUNTIF + COUNTIF

    Habka ugu fudud ee loo tiriyo unugyada leh hal qiime ama mid kale (Countif a<2)> ama b ) waa in la qoro qaacido COUNTIF joogto ah si loo tiriyo shay kasta si gaar ah, ka dibna lagu daro natiijooyinka:

    COUNTIF( range, criterion1) + COUNTIF ( kala duwan, shuruud 2)

    SidaTusaale ahaan, aynu ogaano inta unug ee tiirka A ku jira midkood "tufaax" ama "mooska":

    =COUNTIF(A:A, "apples") + COUNTIF(A:A, "bananas")

    marka loo eego tiirarka oo dhan si ay qaacidadu u shaqeyso si dhakhso leh. Si aad isaga ilaaliso dhibaatada cusboonaysiinta caanahaaga mar kasta oo ay xaaladuhu isbedelaan, ku qor shayada xiisaha unugyo hore loo sii qeexay, dheh F1 iyo G1, oo tixraac unugyadaas. Tusaale ahaan:

    =COUNTIF(A2:A10, F1) + COUNTIF(A2:A10, G1)

    >

    Farsamadani waxay si fiican ugu shaqeysaa dhowr shuruudood, laakiin marka la isku daro saddex ama in ka badan oo COUNTIF ah waxay ka dhigaysaa qaacidada mid aad u dhib badan. Xaaladdan oo kale, waxa fiican inaad ku dhegto mid ka mid ah beddelka soo socda.

    Formula 2. COUNTIF oo leh array joogto ah

    Halkan waxaa ah nooca SUMIF oo leh OR shuruudaha qaacidada Excel:

    SUM ( COUNTIF ( kala duwan, { Criterion1, criterion2, criterion3, …}))

    Qaacdadu waa loo dhisay habkan:

    Marka hore, waxaad ku xidhidhaysaa dhammaan shuruudaha hab habaysan oo joogto ah - shay gaar ah oo ay ku kala qaybsan yihiin hakadyo iyo shaxdu waxay ku lifaaqan yihiin xargaha curyaanka ah sida {"tufaax", "mooska', "liin"}.

    Markaa, waxaad ku dartaa array joogto ah Shuruudaha doodda qaacidada COUNTIF ee caadiga ah: COUNTIF 3>

    Ugu dambayntii, ku rog qaacidada COUNTIF ee shaqada SUM. Waa lagama maarmaan sababtoo ah COUNTIF waxay soo celin doontaa 3 xisaabood oo shakhsi ah "tufaax", "mooska" iyo"liin", oo waxaad u baahan tahay inaad ku darto tirooyinkaas oo dhan.

    Qaabkayaga oo dhammaystiran wuxuu u socdaa sidan soo socota:

    =SUM(COUNTIF(A2:A10,{"apples","bananas","lemons"}))

    >

    Haddii aad Haddii aad ka door bidayso shuruudahaaga tixraacyo kala duwan , waxaad u baahan doontaa inaad geliso qaaciddada Ctrl + Shift + Geli si aad uga dhigto qaacido habaysan. Tusaale ahaan:

    =SUM(COUNTIF(A2:A10,F1:H1))

    Fadlan u fiirso xargaha curdanka ah ee shaashadda hoose - waa tilmaanta ugu cadcad ee qaabka habaysan ee Excel:

    >> >

    Formula 3. SUMPRODUCT

    Habka kale ee lagu tiriyo unugyada leh AMA macquulka ah ee Excel waa in la isticmaalo shaqada SUMPRODUCT habkan:

    SUMPRODUCT(1*( range = { criterion1 , criterion2 , criterion3 , …}))

    Si aad sifiican ugu sawirto macquulka, tan waxa kale oo loo qori karaa sida:

    SUMPRODUCT( ( kala duwan = Seerka1 ) + ( kala duwanaanshaha = Seerka2 ) + …)

    Qaciidada waxa ay tijaabinaysaa unug kasta oo u dhexeeya inta u dhaxaysa shuruud kasta oo soo celisa RUN haddii shuruudaha la buuxiyo, BEEN haddii kale. Natiijo dhexdhexaad ah, waxaad heleysaa dhowr qaybood oo ah qiyamka RUN iyo BEENTA ah (tirada arrays waxay la mid tahay tirada shuruudahaaga). Dabadeed, curiyayaasha array ee isku meel ku yaal ayaa la isku daraa, tusaale ahaan curiyayaasha ugu horreeya ee dhammaan arraysyada, curiyayaasha labaad, iwm. Hawlgalka isku-darka ah wuxuu u beddelaa qiyamka macquulka ah ee nambarada, markaa waxaad ku dhammaanaysaa hal shax oo ah 1's (mid ka mid ah shuruudaha u dhigma) iyo 0's (mid ka mid ah shuruudaha uma dhigma). Sababtoo ah dhammaan shuruudaha waalagu tijaabiyey isla unugyo, ma jirto sinaba tiro kale uga soo bixi karto soo koobida natiijada - kaliya hal array hore ayaa RUN ku yeelan kara boos gaar ah, kuwa kalena waxay yeelan doonaan BEEN. Ugu dambayntii, SUMPRODUCT waxay ku daraysaa curiyayaasha shaxda natiijada ka soo baxday, waxaadna helaysaa tirinta la rabo.

    Qaciidada kowaad waxay u shaqaysaa si la mid ah, iyada oo ay ku kala duwan tahay inay soo celiso hal 2-cabbir ah oo kala duwan oo qiyam ah RUN iyo BEEN. , taas oo aad ku dhufato 1 si aad u beddesho qiyamka macquulka ah ee 1 iyo 0, siday u kala horreeyaan.

    Marka lagu dabaqo xogta muunadayada, qaab-dhismeedyadu waxay qaataan qaabkan soo socda:

    =SUMPRODUCT(1*(A2:A10={"apples","bananas","lemons"}))

    > Ama

    =SUMPRODUCT((A2:A10="apples") + (A2:A10="bananas") + (A2:A10="lemons"))

    Ku beddel shaxanka adag ee joogtada ah oo leh tixraac kala duwan, oo waxaad heli doontaa xitaa xal aad u qurux badan:

    =SUMPRODUCT(1*( A2:A10=F1:H1))

    <15

    Fiiro gaar ah. Shaqada SUMPRODUCT waa ay ka gaabisaa COUNTIF, waana sababta ugu wanaagsan ee caanahan loo isticmaalo in lagu isticmaalo xog yar sets kuwaas oo leh xiriir heer-kala duwan iyo heer-goboleedka u dhexeeya canaasirta, fursadaha waa in aad u baahan doontaa in aad tiriso unugyada leh OR iyo AND xaaladaha.

    Tusaale ahaan, aan helno tirinta "tufaax" , "mooska" iyo "liin" oo "la keeno". Sideen u samaynaa taas? Bilawga, aynu u turjunno shuruudahayaga luqadda Excel:

    • Column A: "tufaax" ama "mooska" ama "liin"
    • Column C: "lagu keenay"

    Ka eegxagal kale, waxaan u baahanahay in aan tirino saf leh "tufaax oo la keenay" AMA "mooska oo la keenay" AMA "liin iyo keenay". Sidan u dhig, hawshu waxay hoos ugu dhacdaa tirinta unugyada leh 3 AMA shuruudood - sida saxda ah ee aan ku samaynay qaybta hore! Waxa kaliya ee ay ku kala duwan yihiin waa in aad isticmaali doonto COUNTIFS halkii aad ka isticmaali lahayd COUNTIF si aad u qiimayso IYO heerka ku jira xaalad kasta AMA.

    Formula 1. COUNTIFS + COUNTIFS

    Waa qaacidada ugu dheer, taas oo ah Sida ugu fudud loo qoro>Formula 2. COUNTIFS oo leh habayn joogto ah

    Qaabka COUNTIFS oo is haysta oo leh AND/AMA macquul ah waxa lagu abuuri karaa baakad AMA shuruudo joogta ah:

    > =SUM(COUNTIFS(A2:A10, {"apples","bananas","lemons"}, C2:C10, "delivered"))

    Marka Adiga oo isticmaalaya tixraac kala duwan ee shuruudaha, waxaad u baahan tahay qaacido array ah, oo lagu dhammaystiray adigoo riixaya Ctrl + Shift + Geli :

    > =SUM(COUNTIFS(A2:A10,F1:H1,C2:C10,F2))

    > 19>

    > Talo. Haddii loo baahdo, waxaad xor u tahay inaad isticmaasho kaarka duurjoogtamarka loo eego habraac kasta oo xagga sare lagaga hadlay. Tusaale ahaan, si aad u tiriso dhammaan noocyada muuska sida "mooska cagaarka ah" ama "mooska farta dahabka ah" waxaad isticmaali kartaa caanahan:

    =SUM(COUNTIFS(A2:A10, {"apples","*bananas*","lemons"}, C2:C10, "delivered"))

    Si la mid ah, waxaad dhisi kartaa qaacido aad ku tiriso unugyo ku salaysan. noocyada kale ee shuruudaha. Tusaale ahaan, si loo helo tiro "tufaax" ama "moos" ama "liin" oo "la keenay" oo qaddarkeedu ka badan yahay 200, ku dar hal shuruudo dheeraad ah oo kala duwanCOUNTIFS:

    =SUM(COUNTIFS(A2:A10, {"apples","*bananas*","lemons"}, C2:C10, "delivered", B2:B10, ">200"))

    > Ama, isticmaal qaacidada diyaarinta ah (lagu galiyay Ctrl + Shift + Geli):

    =SUM(COUNTIFS(A2:A10,F1:H1,C2:C10,F2, B2:B10, ">"&F3))

    > 20>

    Tiri unugyo leh xaalado AMA badan

    Tusaalaha hore, waxaad baratay sida loo tijaabiyo hal shuruudo AMA ah. Laakiin ka waran haddii aad haysato laba ama in ka badan oo aad raadinayso inaad hesho wadarta dhammaan suurtogalka ah AMA xidhiidhada oo leh ISNUMBER MATCH. Kan hore waa sahlan tahay in la dhiso, laakiin waxay ku kooban tahay 2 shuruudood oo keliya. Tan dambe waxay qiimeyn kartaa tiro kasta oo shuruudo ah (lambar macquul ah, dabcan, marka la eego xadka Excel ee 255 doodaha iyo 8192 xaraf ee wadarta guud ee caanaha), laakiin waxay qaadan kartaa xoogaa dadaal ah si loo fahmo caqliga qaacidada.

    Tiri unugyo leh 2 qaybood oo shuruudo AMA ah

    Markaad la macaamilayso laba qaybood oo ah shuruudo AMA, kaliya ku dar hal habayn dheeraad ah oo joogto ah qaacidada COUNTIFS ee kor lagu soo hadal qaaday.

    >Si ay qaaciddu u shaqeyso, hal Daqiiqad laakiin isbeddel muhiim ah ayaa loo baahan yahay: isticmaal array horizontal(cutubyo ay ku kala qaybsan yihiin hakadka) hal shuruudood oo la dejiyay iyo array toosanTani waxay u sheegaysaa Excel inuu "lammaaneeyo" ama "iskutallaabta xisaabiyo" canaasirta ku jirta labada qaybood, oo soo celiso laba-geesoodka natiijooyinka.

    Tusaale ahaan, aan tirino "tufaax", "mooska" ama"liin" kuwaas oo ama "la keenay" ama "transit":

    >

    =SUM(COUNTIFS(A2:A10, {"apples", "bananas", "lemons"}, B2:B10, {"delivered"; "in transit"}))

    Sababtoo ah Excel waa barnaamij 2-cabbir ah, suurtagal maaha in la dhiso 3-cabbir ama 4-cabbir ah, sidaas darteed qaaciddadani waxay u shaqeysaa oo keliya laba qaybood oo AMA ah. Si loo xisaabiyo shuruudo badan, waa inaad u beddeshaa qaaciido SUMPRODUCT oo aad u adag oo lagu sharaxay tusaalaha soo socda.

    Tiri unugyada leh noocyo badan oo xaalado AMA ah

    >Si aad u tiriso unugyo ka badan laba jaantusyada AMA, isticmaal shaqada SUMPRODUCT oo ay weheliso ISNUMBER MATCH.

    Tusaale ahaan, aynu helno tirinta "tufaax", "mooska" ama "liin" oo midkood "la keeno" ama "transit" oo lagu baakadeeyay midkood "bac" ama "tray":

    =SUMPRODUCT(ISNUMBER(MATCH(A2:A10,{"apples","bananas","lemons"},0))*

    ISNUMBER(MATCH(B2:B10,{"bag",,"tray"},0))*<3

    ISNUMBER(C2:C10,{"lagu geeyey", transit"},0)))

    Wadnaha qaaciddada, shaqada MATCH waxay hubisaa shuruudaha iyadoo la barbardhigayo unug kasta ee kala duwanaanshaha la cayimay oo leh habayn joogto ah oo u dhiganta. Haddii ciyaarta la helo, waxay soo celinaysaa meel qaraabo ah oo qiimihiisu yahay, haddii shaxdu, N/A haddii kale. ISNUMBER waxay qiimayaashan u beddeshaa RUN iyo BEEN, kuwaas oo u dhigma 1 iyo 0, siday u kala horreeyaan. SUMPRODUCT halkaas ayay ka qaadaa, oo way dhufataa curiyayaasha arrays-yada. Sababtoo ah ku dhufashada eber waxay siinaysaa eber, kaliya unugyada leh 1 ee dhammaan arraysyada ayaa badbaaday oo

    Shaashada hoose waxay muujinaysaa natiijada:

    > > sidoo kale AMA shuruudaha. Si aad si dhow ugu fiirsato qaacidooyinka looga hadlay casharkan, waxaa lagugu soo dhawaynayaa inaad soo dejiso buuga shaqada ee tusaalaha ah ee hoose. Waxaan kaaga mahadcelinayaa akhrinta waxaana rajeynayaa inaan kugu arko blogkeena usbuuca soo socda!

    Ku celceli buuga shaqada

    Excel COUNTIF oo leh AMA shuruudo - tusaaleyaal (.xlsx file)

    Michael Brown waa xamaasad tignoolajiyada u heellan oo xiise u leh fududaynta hababka adag iyadoo la adeegsanayo aaladaha software. In ka badan toban sano oo waayo-aragnimo ah oo ku saabsan warshadaha teknoolajiyada, wuxuu ku horumariyay xirfadihiisa Microsoft Excel iyo Outlook, iyo sidoo kale Google Sheets iyo Docs. Blog-ga Michael wuxuu u heellan yahay inuu la wadaago aqoontiisa iyo khibradiisa dadka kale, isagoo siinaya tabo-fudud oo la raaco iyo casharro lagu horumarinayo wax soo saarka iyo hufnaanta. Haddii aad tahay xirfadle khibrad leh ama bilow ah, Michael's blog wuxuu bixiyaa fikrado qiimo leh iyo talooyin wax ku ool ah si aad uga faa'iidaysato qalabkan software-ka ah ee muhiimka ah.