Loncat ke daftar isi utama

Bagaimana cara menghitung jumlah kata dalam sel atau sel rentang di Excel?

Anda dapat dengan mudah menghitung jumlah kata di MS Word, tetapi Excel tidak memiliki alat bawaan untuk menghitung jumlah kata dalam lembar kerja. Namun, Anda bisa menghitung jumlah kata di Excel dengan metode berikut:

Hitung jumlah kata dengan rumus
Hitung jumlah kata dalam satu sel dengan User Defined Functions
Hitung jumlah kata dalam rentang tertentu dengan kode VBA
Mudah menghitung jumlah kata dengan Kutools for Excel (beberapa klik)


Hitung jumlah kata dengan rumus

Berikut adalah dua rumus bagi Anda untuk menghitung kata dalam satu sel dan dalam sel rentang.

Hitung kata dalam satu sel

Harap masukkan rumus ini =IF(LEN(TRIM(A2))=0,0,LEN(TRIM(A2))-LEN(SUBSTITUTE(A2," ",""))+1) ke dalam Formula Bar, lalu tekan Enter kunci.

Note: Dalam rumusnya, A2 adalah sel yang akan Anda hitung jumlah kata di dalamnya.

Anda dapat melihat hasilnya seperti gambar di bawah ini:

Hitung kata dalam satu rentang sel dengan rumus array

Jika Anda ingin menghitung kata dalam satu rentang sel, masukkan rumus =SUM(IF(LEN(TRIM(A2:A3))=0,0,LEN(TRIM(A2:A3))-LEN(SUBSTITUTE(A2:A3," ",""))+1)) ke dalam bilah rumus, lalu tekan perubahan + Ctrl + Enter kunci secara bersamaan untuk mendapatkan hasilnya. Lihat tangkapan layar:

Note: A2: A3 adalah rentang dengan kata-kata yang akan Anda hitung.

Hitung total kata dengan mudah dalam sel atau rentang sel di Excel:

Grafik Hitung Total Kata kegunaan Kutools for Excel dapat membantu Anda dengan cepat menghitung total kata dalam sel atau rentang sel di Excel seperti yang ditunjukkan demo di bawah ini.
Unduh dan coba sekarang! (30- jalur bebas hari)


Hitung jumlah kata dengan User Defined Functions

Selain itu, Anda dapat menghitung kata dalam sel dengan User Defined Functions, lakukan hal berikut:

1. tekan lain + F11 kunci bersama untuk membuka Microsoft Visual Basic untuk aplikasi jendela.

2. Di winodw, klik Menyisipkan > Modul, lalu salin dan tempel kode VBA di bawah ini ke dalam Modul. Lihat tangkapan layar:

Kode VBA: Hitung jumlah kata dalam sel.

Function intWordCount(rng As Range) As Integer
'Update by Extendoffice 2018/3/7
    intWordCount = UBound(Split(Application.WorksheetFunction.Trim(rng.Value), " "), 1) + 1
End Function

2. tekan lain + Q kunci untuk menutup Microsoft Visual Basic untuk Aplikasi winodw. Pilih sel kosong di lembar kerja Anda, masukkan rumus "=intwordcount(A2)”Ke Formula Bar, lalu tekan Enter kunci untuk mendapatkan hasil. Lihat tangkapan layar:

Note: Dalam rumusnya, A2 adalah sel yang akan Anda hitung jumlah kata di dalamnya.

Jika Anda ingin menghitung jumlah kata dalam rentang tertentu, harap terapkan metode berikut.


Hitung jumlah kata dalam rentang tertentu dengan kode VBA

Kode VBA berikut dapat membantu Anda menghitung jumlah kata dengan cepat dalam rentang tertentu.

1. tekan lain + F11 kunci bersama untuk membuka Microsoft Visual Basic untuk aplikasi jendela.

2. Di winodw, klik Menyisipkan > Modul, lalu salin dan tempel kode VBA di bawah ini ke dalam Modul. Lihat tangkapan layar:

Kode VBA: Hitung jumlah kata dalam rentang yang dipilih.

Sub CountWords()
    Dim xRg As Range
    Dim xRgEach As Range
    Dim xAddress As String
    Dim xRgVal As String
    Dim xRgNum As Long
    Dim xNum As Long
    On Error Resume Next
    xAddress = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Please select a range:", "Kutools For Excel", xAddress, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    Application.ScreenUpdating = False
    If Application.WorksheetFunction.CountBlank(xRg) = xRg.Count Then
        MsgBox "Words In Selection Is: 0", vbInformation, "Kutools For Excel"
        Exit Sub
    End If
    For Each xRgEach In xRg
        xRgVal = xRgEach.Value
        xRgVal = Application.WorksheetFunction.Trim(xRgVal)
        If xRgEach.Value <> "" Then
            xNum = Len(xRgVal) - Len(Replace(xRgVal, " ", "")) + 1
            xRgNum = xRgNum + xNum
        End If
    Next xRgEach
    MsgBox "Words In Selection Is: " & Format(xRgNum, "#,##0"), vbOKOnly, "Kutools For Excel"
    Application.ScreenUpdating = True
End Sub

3. tekan F5 kunci untuk menjalankan kode. Dalam bermunculan Kutools for Excel kotak dialog, pilih rentang yang akan Anda hitung jumlah kata di dalamnya, lalu klik OK tombol. Lihat tangkapan layar:

Lalu lainnya Kutools for Excel kotak dialog muncul untuk menampilkan jumlah kata dalam rentang yang dipilih. Lihat tangkapan layar:


Hitung jumlah kata dengan Kutools for Excel (hanya klik)

YAnda dapat mencoba Hitung kata dalam jangkauan kegunaan Kutools for Excel untuk dengan mudah menghitung jumlah kata dalam sel atau rentang hanya dengan beberapa klik.

Sebelum melamar Kutools for Excel, Mohon unduh dan instal terlebih dahulu.

1. Pilih sel untuk mengembalikan hasilnya, lalu klik Kutools > Pembantu Formula > Pembantu Formula.

2. Dalam Rumus Pembantu kotak dialog, konfigurasikan sebagai berikut.

  • Dalam majalah Pilih rumus kotak, pilih Hitung total kata;
    Tips: Anda dapat memeriksa Filter kotak, masukkan kata kunci untuk memfilter rumus dengan cepat sesuai kebutuhan Anda.
  • Dalam majalah Jarak kotak, tentukan sel atau rentang di mana Anda ingin menghitung total kata;
  • klik OK tombol. Lihat tangkapan layar:

Kemudian Anda akan mendapatkan jumlah kata dalam sel atau rentang tertentu.

  Jika Anda ingin memiliki uji coba gratis (30-day) dari utilitas ini, silahkan klik untuk mendownloadnya, lalu lanjutkan untuk menerapkan operasi sesuai langkah di atas.


Mudah menghitung jumlah kata dengan Kutools for Excel

  Kutools for Excel termasuk 300+ fitur canggih untuk Microsoft Excel. Bebas mencoba tanpa batasan dalam 30 hari. Unduh sekarang!

Alat Produktivitas Kantor Terbaik

Fitur Populer: Temukan, Sorot, atau Identifikasi Duplikat   |  Hapus Baris Kosong   |  Gabungkan Kolom atau Sel tanpa Kehilangan Data   |   Putaran tanpa Formula ...
Pencarian Super: VLookup Beberapa Kriteria    VLookup Nilai Berganda  |   VLookup di Beberapa Lembar   |   Pencarian Fuzzy ....
Daftar Drop-down Lanjutan: Buat Daftar Drop Down dengan Cepat   |  Daftar Drop Down yang Bergantung   |  Multi-pilih Drop Down List ....
Manajer Kolom: Tambahkan Jumlah Kolom Tertentu  |  Pindahkan Kolom  |  Alihkan Status Visibilitas Kolom Tersembunyi  |  Bandingkan Rentang & Kolom ...
Fitur Unggulan: Fokus Kisi   |  Tampilan Desain   |   Bar Formula Besar    Manajer Buku Kerja & Lembar   |  Perpustakaan Sumberdaya (Teks otomatis)   |  Pemetik tanggal   |  Gabungkan Lembar Kerja   |  Enkripsi/Dekripsi Sel    Kirim Email berdasarkan Daftar   |  Filter Super   |   Filter Khusus (filter tebal/miring/coret...) ...
15 Perangkat Teratas12 Teks Tools (Tambahkan Teks, Hapus Karakter, ...)   |   50 + Grafik jenis (Gantt Chart, ...)   |   40+ Praktis Rumus (Hitung usia berdasarkan ulang tahun, ...)   |   19 Insersi Tools (Masukkan Kode QR, Sisipkan Gambar dari Jalur, ...)   |   12 Konversi Tools (Angka ke Kata, Konversi Mata Uang, ...)   |   7 Gabungkan & Pisahkan Tools (Lanjutan Gabungkan Baris, Pisahkan Sel, ...)   |   ... dan banyak lagi

Tingkatkan Keterampilan Excel Anda dengan Kutools for Excel, dan Rasakan Efisiensi yang Belum Pernah Ada Sebelumnya. Kutools for Excel Menawarkan Lebih dari 300 Fitur Canggih untuk Meningkatkan Produktivitas dan Menghemat Waktu.  Klik Di Sini untuk Mendapatkan Fitur yang Paling Anda Butuhkan...

tab kte 201905


Office Tab Menghadirkan antarmuka Tab ke Office, dan Membuat Pekerjaan Anda Lebih Mudah

  • Aktifkan pengeditan dan pembacaan tab di Word, Excel, PowerPoint, Publisher, Access, Visio, dan Project.
  • Buka dan buat banyak dokumen di tab baru di jendela yang sama, bukan di jendela baru.
  • Meningkatkan produktivitas Anda sebesar 50%, dan mengurangi ratusan klik mouse untuk Anda setiap hari!
Comments (32)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Thanks a lot for sharing this formula. I pasted it and changed the cell reference to fit my sheet. Thanks a lot.
This comment was minimized by the moderator on the site
OMG THANK YOU FOR THIS GOOD INFO
This comment was minimized by the moderator on the site
If the cell is empty is is incorrectly displaying a count of 1. To correct this I changed the formula to:


=IF(LEN(TRIM(A1)) > 0, LEN(TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1),",",""))+1, 0)
This comment was minimized by the moderator on the site
You are the best. The formula worked for me effortlessly. Kudos!!!
This comment was minimized by the moderator on the site
is there any function will count if i kept cells in one color??? ( i mean to know if filled with same colour is there any formula to count the number of colour boxes)
This comment was minimized by the moderator on the site
Is a chance that this function will count only unique words. For example if word exist in a range two times will count only one, will not count duplicates
This comment was minimized by the moderator on the site
Hi,
For counting only the unique words in a range, please apply this formula (please replace A1:A9 with the range based on your needs): =SUMPRODUCT(1/COUNTIF(A1:A9,A1:A9)). Thank you for your comment.
This comment was minimized by the moderator on the site
Is chance that this formula will count only unique words. My question is if word will exist 2 times in range will count that word only once without counting duplicates?
This comment was minimized by the moderator on the site
I need to clip words from a paragraph like this

"Advised that device is out of warranty and that no repair available so we would recommend that this unit be removed from svc and replaced if they need a device that will provide audible prompts. Sales rep will go to the customer site and advise them of this.
Closing case while wait"
I want to specify a word and in return I want the preceding and succeeding word to come along with the one I specify, like if I specify "svc" output should be "from svc and" .
please Help
This comment was minimized by the moderator on the site
It is telling me: "The formula you typed contains error. Please make sure you have typed in the arguments according to the remark of the formula!"


Every cell contains only one word. I also double checked, everything is "text".
Is there a solution to this problem?
This comment was minimized by the moderator on the site
This is exactly the problem I have... :( Did you found a solution?
This comment was minimized by the moderator on the site
This is superb. Thank you - just what I needed!!

PS Only.... I thought I was pretty clued up with using excel and now it's made me realise I am a mere novice compared to some!! :-D
This comment was minimized by the moderator on the site
Hi and thank you for this - the first formula is just what I need, but is there a way to automatically apply it to the same cell in each row please: D1, E1, F1 etc?
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations