Note: The other languages of the website are Google-translated. Back to English
Mewngofnodi  \/ 
x
or
x
Cofrestru  \/ 
x

or

Sut i gyfrif a yw'r gell yn cynnwys testun neu ran o destun yn Excel?

Gan dybio bod gennych y data isod, ac eisiau cyfrif nifer y celloedd sy'n cynnwys y testun "Afal", mae nifer y celloedd yn cynnwys y testun"Oren"ac mae celloedd yn cynnwys"Peach"ar wahân, sut i wneud hynny? Yn y tiwtorial hwn, rydym yn esbonio'r COUNTIF gweithredu'n fanwl i'ch helpu i gyfrif nifer y celloedd yn gyflym os ydyn nhw'n cynnwys testun neu ran o destun penodol yn Excel. Ar ben hynny, rydym yn cyflwyno nodwedd anhygoel i'w sicrhau'n hawdd gyda dim ond cliciau.


Cyfrif os yw'r gell yn cynnwys testun neu ran o destun gyda'r swyddogaeth COUNTIF

Gall swyddogaeth COUNTIF helpu i gyfrif celloedd sy'n cynnwys rhan o destun mewn ystod o gelloedd yn Excel. Gwnewch fel a ganlyn.

1. Dewiswch gell wag (fel E5), copïwch y fformiwla isod i mewn iddi ac yna pwyswch y Rhowch allwedd. Ac yna llusgwch y Llenwi Trin i lawr i gael yr holl ganlyniadau.

=COUNTIF(B5:B10,"*"&D5&"*")

Cystrawen

=COUNTIF (range, criteria)

Dadleuon

  • Ystod (gofynnol): Yr ystod o gelloedd rydych chi am eu cyfrif.
  • Meini Prawf (gofynnol): Rhif, mynegiant, cyfeirnod celloedd, neu linyn testun sy'n penderfynu pa gelloedd fydd yn cael eu cyfrif.

Nodiadau:

  • Yn y fformiwla, B5: B10 yw'r ystod o gelloedd rydych chi am eu cyfrif. D5 yw'r cyfeirnod cell sy'n cynnwys yr hyn rydych chi am edrych amdano. Gallwch newid y gell gyfeirio a'r meini prawf yn y fformiwla yn ôl yr angen.
  • Os ydych chi am deipio'r testun yn uniongyrchol yn y fformiwla i'w gyfrif, defnyddiwch y fformiwla isod:
    =COUNTIF(B5:B10,"*Apple*")
  • Mae'r fformiwla hon yn achos-ansensitif.

Dim ond sawl clic all gyfrif os yw'r gell yn cynnwys testun neu ran o destun yn Excel:

Daeth Dewiswch Gelloedd Penodol cyfleustodau Kutools ar gyfer Excel gall eich helpu i gyfrif nifer y celloedd mewn ystod yn gyflym os ydyn nhw'n cynnwys testun penodol neu ran o destun. Ar ôl cael y canlyniad mewn blwch deialog popio i fyny, bydd yr holl gelloedd sy'n cyfateb yn cael eu dewis yn awtomatig. Cliciwch am fanylion.
Dadlwythwch Kutools ar gyfer Excel nawr! (Llwybr am ddim 30 diwrnod)


Mae celloedd cyfrif yn cynnwys testun â swyddogaeth COUNTIF

Fel y dangosir y screenshot isod, os ydych chi am gyfrif nifer y celloedd mewn ystod benodol sy'n cynnwys testun yn unig, gall dull yn yr adran hon eich helpu chi.

1. Dewiswch gell wag i allbwn y canlyniad, copïwch y fformiwla isod iddi a gwasgwch y Rhowch allweddol.

=COUNTIF(B5:B10,"*")


Cyfrif os yw'r gell yn cynnwys testun neu ran o destun gyda Kutools ar gyfer Excel

Tip: Heblaw am y fformiwla uchod, cyflwynwch nodwedd anhygoel i ddatrys y broblem hon yn hawdd. Efo'r Dewiswch Gelloedd Penodol cyfleustodau Kutools ar gyfer Excel, gallwch chi gyfrif yn gyflym os yw'r gell yn cynnwys testun neu ran o destun gyda chliciau. Gallwch hyd yn oed gyfrif gyda OR neu And condition fel y mae ei angen arnoch gyda'r nodwedd hon. Gwnewch fel a ganlyn.

Cyn defnyddio'r Kutools ar gyfer Excel, mae angen i chi gymryd munudau i ei lawrlwytho am ddim a'i osod yn gyntaf.

1. Dewiswch yr ystod rydych chi am gyfrif nifer y celloedd sy'n cynnwys testun penodol.

2. Cliciwch Kutools > dewiswch > Dewiswch Gelloedd Penodol.

3. Yn y Dewiswch Gelloedd Penodol blwch deialog, mae angen i chi:

  • dewiswch Cell opsiwn yn y Math o ddewis adran;
  • Yn y Math penodol adran, dewiswch Yn cynnwys yn y gwymplen, nodwch Afal yn y blwch testun;
  • Cliciwch ar y OK botwm.
  • Yna mae blwch prydlon yn ymddangos i ddweud wrthych faint o gelloedd sy'n cyfateb i'r cyflwr. Cliciwch y OK botwm a dewisir pob cell gymwysedig ar yr un pryd.

 Awgrym. Os ydych chi am gael treial am ddim (60 diwrnod) o'r cyfleustodau hwn, cliciwch i'w lawrlwytho, ac yna ewch i gymhwyso'r llawdriniaeth yn ôl y camau uchod.


Erthyglau perthnasol

Defnyddiwch countif gyda meini prawf lluosog yn Excel
Yn Excel, gall swyddogaeth COUNTIF ein helpu i gyfrifo nifer gwerth penodol mewn rhestr. Ond weithiau, mae angen i ni ddefnyddio meini prawf lluosog ar gyfer cyfrif, bydd hyn yn fwy cymhleth. Bydd y tiwtorial hwn yn dangos dulliau i chi ei gyflawni.
Cliciwch i wybod mwy ...

Cyfrif a yw celloedd yn dechrau gyda neu'n gorffen gyda thestun penodol yn Excel
Gan dybio bod gennych chi ystod o ddata a'ch bod chi am gyfrif nifer y celloedd sy'n dechrau gyda “kte” neu'n gorffen gyda “kte” mewn taflen waith. Mae'r erthygl hon yn cyflwyno rhai triciau yn lle cyfrif â llaw i chi.
Cliciwch i wybod mwy ...

Cyfrif gwerth penodol ar draws sawl taflen waith
Sut allech chi gyfrif gwerthoedd penodol ar draws taflen waith luosog? Megis cael nifer yr achosion o werth penodol “Excel” o sawl taflen waith. Mae'r tiwtorial hwn yn cyflwyno dulliau i'w gyflawni.
Cliciwch i wybod mwy ...


Demo: Cyfrif os yw'r gell yn cynnwys testun neu ran o destun gyda Kutools ar gyfer Excel



  • Bar Fformiwla Gwych (golygu llinellau lluosog o destun a fformiwla yn hawdd); Cynllun Darllen (darllen a golygu nifer fawr o gelloedd yn hawdd); Gludo i'r Ystod Hidlo...
  • Uno Celloedd / Rhesi / Colofnau a Cadw Data; Cynnwys Celloedd Hollt; Cyfuno Rhesi Dyblyg a Swm / Cyfartaledd... Atal Celloedd Dyblyg; Cymharwch y Meysydd...
  • Dewiswch Dyblyg neu Unigryw Rhesi; Dewiswch Blank Rows (mae pob cell yn wag); Darganfyddiad Gwych a Darganfyddiad Niwlog mewn Llawer o Lyfrau Gwaith; Dewis ar Hap ...
  • Copi Union Celloedd Lluosog heb newid cyfeirnod fformiwla; Auto Creu Cyfeiriadau i Daflenni Lluosog; Mewnosod Bwledi, Blychau Gwirio a mwy ...
  • Fformiwlâu Hoff a Mewnosod yn Gyflym, Meysydd, Siartiau a Lluniau; Amgryptio Celloedd gyda chyfrinair; Creu Rhestr Bostio ac anfon e-byst ...
  • Testun Detholiad, Ychwanegu Testun, Tynnu yn ôl Swydd, Tynnwch y Gofod; Creu ac Argraffu Subtotals Paging; Trosi rhwng Cynnwys a Sylwadau Celloedd...
  • Hidlo Super (arbed a chymhwyso cynlluniau hidlo i ddalenni eraill); Trefnu Uwch yn ôl mis / wythnos / dydd, amlder a mwy; Hidlo Arbennig gan feiddgar, italig ...
  • Cyfuno Llyfrau Gwaith a Thaflenni Gwaith; Uno Tablau yn seiliedig ar golofnau allweddol; Rhannwch Ddata yn Daflenni Lluosog; Trosi Swp xls, xlsx a PDF...
  • Grwpio Tabl Pivot yn ôl rhif wythnos, diwrnod o'r wythnos a mwy ... Dangos Celloedd Datgloi, wedi'u Cloi yn ôl gwahanol liwiau; Amlygu Celloedd sydd â Fformiwla / Enw...
tab kte 201905
  • Galluogi golygu a darllen tabbed yn Word, Excel, PowerPoint, Cyhoeddwr, Mynediad, Visio a Phrosiect.
  • Agor a chreu dogfennau lluosog mewn tabiau newydd o'r un ffenestr, yn hytrach nag mewn ffenestri newydd.
  • Yn cynyddu eich cynhyrchiant 50%, ac yn lleihau cannoedd o gliciau llygoden i chi bob dydd!
gwaelod officetab
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Jan · 1 years ago
    Did someone check this on Macintosh? Im struggeling in Excel365, and cant get a substring to count. Something with using the asteric on the Mac? That blows!
  • To post as a guest, your comment is unpublished.
    lacristein@gmail.com · 2 years ago
    EXCELENTE MUCHAS GRACIAS!!!! ME SIRVIÓ DE MUCHO!!!!
  • To post as a guest, your comment is unpublished.
    Bala · 2 years ago
    Want to countif

    How many apple text in row2 when row 3 is apple farm
  • To post as a guest, your comment is unpublished.
    bubie · 2 years ago
    hi tolong. macam mana ni?
  • To post as a guest, your comment is unpublished.
    Brian · 2 years ago
    Okay, what if I want to do a countif on a specific position in the cell. I'm looking for an 'r' in the third character following a '-' in the cell. So in English count only cells where the third character following the dash ('-') is an 'r'.
    • To post as a guest, your comment is unpublished.
      crystal · 2 years ago
      Hi Brian,
      Sorry can't help you with that yet.
  • To post as a guest, your comment is unpublished.
    Renee · 3 years ago
    Hi,
    needing help please, i need this to do count over 33 work sheets with the same name. this is what i tried to start with =COUNTIF( "1 - 33'!,"*Bosch MIC 7000i IP7230 1080p*") - but no go. the 1 - 33 is the number range of spreadsheet names.

    How ever this is where it gets trickier.
    i need it to also include the totals in the individual spread sheet - name of product / part number and supplier....
    so simple hahahaha
    • To post as a guest, your comment is unpublished.
      crystal · 2 years ago
      Hi Renee,
      Thank you for sharing it.
  • To post as a guest, your comment is unpublished.
    Tresa · 3 years ago
    Is there a way to use the COUNTIF function but rather than typing in the word to count, the formula can look at another cell where the user could type the name into the cell and the cell next to it (with the COUNTIF function) will show how many time the typed in date is in the worksheet?
    • To post as a guest, your comment is unpublished.
      Honza · 3 years ago
      Yes, I've just used it. Assuming the cell where you type this word is C1, the syntax would be following: =COUNTIF(A2:A6,"*"&C1&"*"). Also works with SUMIF, you just add the third condition (sum range).
  • To post as a guest, your comment is unpublished.
    No · 3 years ago
    Thank you!
  • To post as a guest, your comment is unpublished.
    ravikumar · 3 years ago
    Dear Crystal ,

    Please find this Excel ..


    i cannot solve this ...


    My Problem is i want to show yes or no for column J reached 80 % (subtotal) other wise highlight the cell untill reached 80% of the total .and also give me the formula for the same.


    thanks a lot for your quick reply.
    • To post as a guest, your comment is unpublished.
      crystal · 3 years ago
      Dear ravikumar,
      Sorry for reply so late. I still can't find your uploaded file. Is there something wrong while uploading?
      You can send it to my email address: zxm@addin99.com or post your question to our forum: https://www.extendoffice.com/forum.html to get more Excel supports from our professional.
  • To post as a guest, your comment is unpublished.
    ravikumar · 3 years ago
    please find this picture and tell me the formula for count by name but remember vin is same or multiple entries done in the same vin ..so please tell me i want to count how many vin my no is +91 8655315561 or whats app me its urgent
    • To post as a guest, your comment is unpublished.
      crystal · 3 years ago
      Good Day,
      Haven't seen your picture. Please upload it with the below Upload files button.
  • To post as a guest, your comment is unpublished.
    rajesh · 3 years ago
    in the column A employee name is written and in column B car number is written and c column accessories amount is written ..etc


    i want count a how many car is billed with accessories in front of their name ...


    i want formula for count function i tried many function but unable to find it ...so please give me solution for this.
  • To post as a guest, your comment is unpublished.
    JoAnn · 3 years ago
    The formula only seems to work if the word I'm counting is the FIRST word in the cell. How do I count the number of cells that CONTAIN that word, whetheror not it's at the beginning of the cell?
    • To post as a guest, your comment is unpublished.
      crystal · 3 years ago
      Dear JoAnn,
      Thank you for your comment. The formula =COUNTIF(A2:A6,"*Apple*") can count the number of cells that contain the word Apple no matter which position it loactes in the cell. Please don't forget to enbrace the word with asterisks.
  • To post as a guest, your comment is unpublished.
    K · 3 years ago
    Hi,


    I have want to count the number of cells which has 2 specific words.

    Example, I have cells which may contain up to 6 words separated by a comma.

    Example:

    A1: banana,apple,orange
    A2: apple,orange,pineapple
    A3: pineapple,banana,guava
    A4: apple,banana,guava
    A5: orange,guava,pineapple
    A6: apple,guava,orange


    I want to count how many cells contain the words Apple AND Orange.


    In the above case, count would be 3


    Please Help, thanks


    K
    • To post as a guest, your comment is unpublished.
      crystal · 3 years ago
      Good Day,
      As the problem you mentioned, please try this array formula =SUM(--(IF((LOWER(LEFT(TRIM(A1:A6),LEN("apple")+1))="apple,"),TRUE,IF(LOWER(RIGHT(TRIM(A1:A6),LEN("apple")+1))=",apple",TRUE,(IF(ISERR(SEARCH(",apple,",TRIM(A1:A6))),FALSE,TRUE))))*IF((LOWER(LEFT(TRIM(A1:A6),LEN("orange")+1))="orange,"),TRUE,IF(LOWER(RIGHT(TRIM(A1:A6),LEN("orange")+1))=",orange",TRUE,(IF(ISERR(SEARCH(",orange,",TRIM(A1:A6))),FALSE,TRUE)))))) + Ctrl + Shift + Enter
  • To post as a guest, your comment is unpublished.
    Moataz · 3 years ago
    i have excel sheet containing 3 columns (Section / Name / Gender)
    what formula can count how many "male" or "female" in very section
    • To post as a guest, your comment is unpublished.
      crystal · 3 years ago
      Dear Moataz,
      Would you please provide a screenshot of your spreadsheet showing what you are exactly trying to do?
  • To post as a guest, your comment is unpublished.
    SUSH · 4 years ago
    I HAVE TO COUNT THE TOTAL CELL WHICH CONTAINS A NAME AND NUMBER, SO HOW TO COUNT NAMES AND NUMBERS IN EXCEL EX. CELL A1:A5 CONTAINS APPLE 2143 BALL 5431 CAT TELL ME HOW TO COUNT IT
    • To post as a guest, your comment is unpublished.
      Vvv · 3 years ago
      =COUNTIF(A1:A5,"APPLE")


      Sorry I am not sure I got your question. Would be nice if you could provide screenshot of what you are trying to do..
      • To post as a guest, your comment is unpublished.
        KyleM · 3 years ago
        Your response doesn't quite work, you must include * around the text you're searching. ie =countif(A1:A5, "*apple*")
      • To post as a guest, your comment is unpublished.
        Kyle · 3 years ago
        Your response does not work in this scenario.
  • To post as a guest, your comment is unpublished.
    Graham · 4 years ago
    Hi,

    Great tutorials.

    This is just what I have been trying to do, however with one exception.

    What I need to do is instead of search and count for a cell that contains apple I need it to search to see if the cells contain the contents of a another cell with wildcard.

    Currently using COUNTIF(I$8:O$30,B36) which is on the most part doing the job. Cell B36 will contain 2 or the initials, eg GP or TV, which works fine but what I need to do is count if the cells contains GP when cell b36 contains GP/TV.

    The formula COUNTIF(I$8:O$30,B36) does not then pick up and count that cell because it is not just GP.

    I know I could use =COUNTIF(A2:A6,"*GP*") however the cell for the code has 52 if commands in it and is repeated on 37 rows so its not ideal to use that.

    Can it be done?

    Thanks for looking
    • To post as a guest, your comment is unpublished.
      Luke · 3 years ago
      Graham, did you ever find a way to do this please? As I'm currently trying to find a way to do the exact same thing.

      Thank you
      • To post as a guest, your comment is unpublished.
        Asger T.P. · 3 years ago
        If we take Graham's example, then you can write: COUNTIF(I$8:O$30,"*"&B36&"*").

        Hope this helps :)
      • To post as a guest, your comment is unpublished.
        KyleM · 3 years ago
        When using =countif(s) you can use * around the specific text you're trying to look for in a statement. For example, I was looking to count cells where they had the word "ran" in them, when they would be vastly different entries. There would be such things as "ran off road", "animal hit/ran off road", "overturn/ran off road".

        So I did basically =countif(range, "*ran*") and it works fine. Hope this helps?
      • To post as a guest, your comment is unpublished.
        Kyle M · 3 years ago
        When using =countif(s) you can use * around the text you're trying to look for in a statement. For example, I was looking to count cells where they had the word "ran" in them, when they would be vastly different entries. There would be such things as "ran off road", "animal hit, ran off road", "overturn, ran off road".

        So I did basically =countif(range, "*ran*") and it works fine. Hope this helps?
    • To post as a guest, your comment is unpublished.
      Vvv · 3 years ago
      What i did before was place the this code: (=COUNTIF(A2:A6,"*GP*")) on 1 cell and another formula in another cell, then just click =SUM on the 2 cells with the code.
      • To post as a guest, your comment is unpublished.
        Tony · 3 years ago
        Try =COUNTIF(I$8:O$30,"="&"*"&B36&"*")
        • To post as a guest, your comment is unpublished.
          J · 3 years ago
          This worked for me, except I don't want it count if the cell is blank. Any suggestions?