Loncat ke daftar isi utama

Bagaimana cara menjumlahkan / menghitung angka tebal dalam berbagai sel di Excel?

Saat Anda memiliki rentang data yang berisi beberapa angka tebal di lembar kerja, dan sekarang Anda ingin menjumlahkan atau menghitung hanya sel yang dicetak tebal, tentunya Anda dapat menambahkannya satu per satu secara manual, tetapi akan memakan waktu. Bagaimana Anda bisa menjumlahkan atau menghitung hanya sel tebal di Excel dengan cara yang mudah dan cepat?

Hitung angka tebal dalam rentang dengan User Defined Function (VBA dan formula)
Jumlahkan angka tebal dalam rentang dengan User Defined Function (VBA dan rumus)
Beberapa klik untuk menghitung dan menjumlahkan sel tebal dalam kisaran dengan Kutools for Excel


Hitung angka tebal dalam rentang dengan User Defined Function

Berikut ini Fungsi Buatan Pengguna dapat membantu Anda mendapatkan jumlah sel tebal dengan cepat. Harap lakukan seperti ini:

1. Tahan ALT + F11 kunci, dan itu membuka Jendela Microsoft Visual Basic for Applications.

2. Klik Menyisipkan > Modul, dan tempel kode berikut di Jendela Modul.

Kode VBA: Hitung angka tebal dalam rentang sel

Function CountBold(WorkRng As Range)
'Update 20220516
Dim Rng As Range
Dim xCount As Double
For Each Rng In WorkRng
    If Rng.Font.Bold Then
        xCount = xCount + 1
    End If
Next
CountBold = xCount
End Function

3. Kemudian simpan kode ini, dan ketikkan rumus ini = CountBold (A1: C9) ke dalam sel kosong, lihat tangkapan layar:

doc-hitung-tebal-sel1

4. Lalu tekan Enter kunci, dan Anda akan menghitung sel tebal di kisaran A1: C9.

doc-hitung-tebal-sel2

Catatan:A1: C9 dalam rumus menunjukkan rentang yang ingin Anda gunakan fungsi untuk menghitung sel tebal, Anda dapat mengubahnya sesuai kebutuhan Anda.


Jumlahkan angka tebal dalam rentang dengan User Defined Function

Dan jika Anda ingin menjumlahkan hanya angka tebal dalam rentang data, saya juga dapat membuat fungsi yang ditentukan pengguna untuk Anda selesaikan.

1. Tahan ALT + F11 kunci, dan itu membuka Jendela Microsoft Visual Basic for Applications.

2. Klik Menyisipkan > Modul, dan tempel kode berikut di Jendela Modul.

Kode VBA: Jumlahkan angka tebal dalam satu rentang sel

Function SumBold(WorkRng As Range)
'Update 20220516
Dim Rng As Range
Dim xSum As Double
For Each Rng In WorkRng
    If Rng.Font.Bold Then
        xSum = xSum + Rng.Value
    End If
Next
SumBold = xSum
End Function

3. Kemudian simpan kode ini, dan ketikkan rumus ini = sumbold (A1: C9) ke dalam sel kosong, lihat tangkapan layar:

doc-hitung-tebal-sel3

4. Lalu tekan Enter kunci, semua angka tebal di kisaran A1: C9 telah ditambahkan. Lihat tangkapan layar:

doc-hitung-tebal-sel4

Catatan:A1: C9 dalam rumus menunjukkan rentang yang ingin Anda gunakan fungsi untuk menjumlahkan sel tebal, Anda dapat mengubahnya sesuai kebutuhan.


Beberapa klik untuk menghitung dan menjumlahkan sel tebal dalam kisaran dengan Kutools for Excel

YAnda dapat dengan mudah menghitung atau menjumlahkan semua sel tebal dalam suatu rentang dengan beberapa klik tanpa menangani kode VBA yang rumit dan mengingat rumus.

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

1. Untuk menghitung sel tebal, pilih sel kosong untuk menemukan hasilnya, lalu klik Kutools > Fungsi Kutools > Statistik & Matematika > COUNTBYFONTBOLD.

Dan untuk menjumlahkan sel tebal, klik Kutools > Fungsi Kutools > Statistik & Matematika > SUMBYFONTBOLD. Lihat tangkapan layar:

2. Di FArgumen pengurapan kotak dialog, tentukan kisaran dengan sel tebal yang perlu Anda hitung atau jumlahkan dalam kotak Referensi, lalu klik OK .

Sekarang penghitungan atau penjumlahan semua sel tebal dalam kisaran tertentu akan segera diisi dalam sel yang dipilih. Lihat tangkapan layar:

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


Jaga agar referensi sel formula konstan dengan Kutools for Excel


Terkait artikel:

Bagaimana cara mengidentifikasi dan memilih semua sel atau teks tebal di Excel?

Alat Produktivitas Kantor Terbaik

馃 Kutools AI Ajudan: Merevolusi analisis data berdasarkan: Eksekusi Cerdas   |  Hasilkan Kode  |  Buat Rumus Khusus  |  Analisis Data dan Hasilkan Grafik  |  Aktifkan Fungsi Kutools...
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 Lanjutan untuk Meningkatkan Produktivitas dan Menghemat Waktu.  Klik Di Sini untuk Mendapatkan Fitur yang Paling Anda Butuhkan...

Deskripsi Produk


Tab Office Membawa antarmuka Tab ke Office, dan Membuat Pekerjaan Anda Jauh 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 (22)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hello Anthony,
I was struggling with the same problem. For me, the solution ended up being very simple. I noticed I had 4 Modules listed. I removed all of them and then started over with the above instructions. Now it works perfectly.
This comment was minimized by the moderator on the site
I use the function and keep getting the #NAME? error. I am using Excel 365 and Windows11.
This comment was minimized by the moderator on the site
Hello, Anthony

Have you copied and pasted the code into the Module of Microsoft Visual Basic for Applications window in your worksheet? Afetr pasting the code, then, you should enter the formula as you need.

Or you can upload your file here, we can check where the problem is.

Thank you!
This comment was minimized by the moderator on the site
Ma se metto in grassetto nuove celle, la somma non si aggiorna !!!
This comment was minimized by the moderator on the site
Hello Carlo,

Gald to help. After you bold new cells, the sum won't update automatically. But when you double-click the formula cell, then press Enter, the sum will update. Please have a try.

Sincerely,
Mandy
This comment was minimized by the moderator on the site
Hi Mandy,
thanks for your reply,
Yes I know that after double click the sum will uograde.
Is there any way to upgrade automatically the sum ?

Regards
Carlo
This comment was minimized by the moderator on the site
Hello Carlo,

Sorry that I don't have the solution for automatically upgrading the sum. The easiest way I can think of is to press Ctrl + Alt + F9 to recalculate all worksheets in all open workbooks. Have a nice day.

Sincerely,
Mandy
This comment was minimized by the moderator on the site
袗 械褋谢懈 胁 褟褔械泄泻邪褏 褔懈褋谢邪 懈 褌械泻褋褌? 薪邪写芯 锌褉芯褋褍屑屑懈褉芯胁邪褌褜 褌芯谢褜泻芯 褟褔械泄泻懈 褋 褔懈褋谢邪屑懈 卸懈褉薪褘屑 褕褉懈褎褌芯屑.
This comment was minimized by the moderator on the site
RE: CountBold formula This formula does not appear to be dynamic. While it works at first pass, if i change the bolded cells the counters do not update unless i re-enter the formula again. Any tips?
This comment was minimized by the moderator on the site
Yea this is the same for me, otherwise it works great. But if this could be solved so it refreshes the count after each cell deselect like other basic counts it would be perfect!
This comment was minimized by the moderator on the site
Dear guys,
The formula won't update if you just change the format of the number cells.
It updates only when you change the cell content.
This comment was minimized by the moderator on the site
I'm using excel for mac 2011. How can I run the code on my system? thanks!
This comment was minimized by the moderator on the site
I copied and pasted code into excel but get #NAME? error. I made sure to enable macros and using excel 2010 version (don't know if that changes anything). Can anyone please help?!
This comment was minimized by the moderator on the site
[quote]I copied and pasted code into excel but get #NAME? error. I made sure to enable macros and using excel 2010 version (don't know if that changes anything). Can anyone please help?!By Maey[/quote] You have to follow the instruction. It says: "Click Insert > Module, and paste the following code in the Module Window", and you have to do exactly so. Make sure you paste the code in the Module Window, not in the Sheet code Window.
This comment was minimized by the moderator on the site
Thank you.. it's working...
This comment was minimized by the moderator on the site
This works a treat. I only have one issue...it doesn't seem to be adding anything after a decimal point. Any help would be greatly appreciated.
This comment was minimized by the moderator on the site
This works perfectly except it doesn't seem to add my decimal places, only adds the whole dollar. If you have a fix for this I would be very grateful.
This comment was minimized by the moderator on the site
Hi Katie, Use the below code, as the sum shows decimal places. Function SumBold(rng As Range) Dim rCell As Range Application.Volatile SumBold = 0 For Each rCell In rng If rCell.Font.Bold Then _ SumBold = SumBold + rCell Next End Function
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