Preskoči na glavno vsebino

Kako seštevati / šteti krepke številke v obsegu celic v Excelu?

Če imate na delovnem listu obseg podatkov, ki vsebuje nekaj krepkih številk, zdaj pa želite povzeti ali prešteti samo krepke celice, jih lahko seveda seštevate ročno, vendar bo to zamudno. Kako bi lahko na preprost in hiter način sešteli ali prešteli samo krepke celice v Excelu?

Štetje krepkih števil v območju z uporabniško določeno funkcijo (VBA in formula)
Povzemite krepke številke v obsegu z uporabniško določeno funkcijo (VBA in formula)
Več jih klikne za štetje in strnitev krepkih celic v obsegu s programom Kutools za Excel


Številčne krepke številke štejte v območju z uporabniško določeno funkcijo

Naslednja Uporabniško določena funkcija vam lahko pomaga hitro pridobiti število krepkih celic. Naredite to:

1. Držite tipko ALT + F11 in odpre tipko Okno Microsoft Visual Basic for Applications.

2. Kliknite Vstavi > Moduliin prilepite naslednjo kodo v Okno modula.

Koda VBA: štetje krepkih številk v območju celic

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. Nato shranite to kodo in vnesite to formulo = CountBold (A1: C9) v prazno celico si oglejte posnetek zaslona:

doc-count-bold-celice1

4. Nato pritisnite Vnesite tipko in šteli boste krepke celice v območju A1: C9.

doc-count-bold-celice2

Opomba:A1: C9 v formuli označuje obseg, za katerega želite uporabiti funkcijo za štetje krepkih celic, jo lahko spremenite po svoji potrebi.


Povzemite krepke številke v obsegu z uporabniško določeno funkcijo

In če želite v območju podatkov strniti samo krepke številke, lahko ustvarim tudi uporabniško določeno funkcijo, ki jo boste rešili.

1. Drži dol ALT + F11 in odpre tipko Okno Microsoft Visual Basic for Applications.

2. Kliknite Vstavi > Moduliin prilepite naslednjo kodo v Okno modula.

Koda VBA: Povzemite krepke številke v območju celic

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. Nato shranite to kodo in vnesite to formulo = povzetek (A1: C9) v prazno celico si oglejte posnetek zaslona:

doc-count-bold-celice3

4. In nato pritisnite Vnesite tipka, so bile vse krepke številke v območju A1: C9 seštete. Oglejte si posnetek zaslona:

doc-count-bold-celice4

Opomba:A1: C9 v formuli označuje obseg, za katerega želite uporabiti funkcijo za seštevanje krepkih celic, jo lahko spremenite po potrebi.


Več jih klikne za štetje in strnitev krepkih celic v obsegu s programom Kutools za Excel

YZ lahkoto lahko štejete ali seštejete vse krepke celice v obsegu z več kliki, ne da bi obdelovali zapleteno kodo VBA in si zapomnili formule.

Pred vložitvijo vloge Kutools za ExcelProsim najprej ga prenesite in namestite.

1. Za štetje krepkih celic izberite prazno celico za iskanje rezultata in kliknite Kutools > Kutools funkcije > Statistični in matematika > COUNTBYFONTBOLD.

Za seštevanje krepkih celic kliknite Kutools > Kutools funkcije > Statistični in matematika > SUMBYFONTBOLD. Oglejte si posnetek zaslona:

2. V Function Argumenti v pogovornem oknu določite obseg s krepkimi celicami, ki jih želite prešteti ali vsoto v referenčnem polju, nato pa kliknite OK gumb.

Zdaj se štetje ali seštevanje vseh krepkih celic v določenem obsegu takoj naseli v izbrano celico. Oglejte si posnetek zaslona:

  Če želite imeti brezplačno (30-dnevno) preskusno različico tega pripomočka, kliknite, če ga želite prenestiin nato nadaljujte z uporabo postopka v skladu z zgornjimi koraki.


V programu Kutools za Excel naj bo referenca celice formule konstantna


Sorodni članki:

Kako prepoznati in izbrati vse krepke celice ali besedilo v Excelu?

Najboljša pisarniška orodja za produktivnost

🤖 Kutools AI Aide: Revolucionirajte analizo podatkov na podlagi: Inteligentna izvedba   |  Ustvari kodo  |  Ustvarite formule po meri  |  Analizirajte podatke in ustvarite grafikone  |  Prikličite funkcije Kutools...
Priljubljene funkcije: Poiščite, označite ali identificirajte dvojnike   |  Izbriši prazne vrstice   |  Združite stolpce ali celice brez izgube podatkov   |   Krog brez formule ...
Super iskanje: Več kriterijev VLookup    Multiple Value VLookup  |   VLookup na več listih   |   Nejasno iskanje ....
Napredni spustni seznam: Hitro ustvarite spustni seznam   |  Odvisni spustni seznam   |  Večkrat izberite spustni seznam ....
Upravitelj stolpcev: Dodajte določeno število stolpcev  |  Premakni stolpce  |  Preklop stanja vidnosti skritih stolpcev  |  Primerjaj obsege in stolpce ...
Predstavljene funkcije: Mrežni fokus   |  Pogled oblikovanja   |   Velika vrstica formule    Upravitelj delovnih zvezkov in listov   |  Knjižnica virov (Samodejno besedilo)   |  Izbirnik datuma   |  Združite delovne liste   |  Šifriranje/dešifriranje celic    Pošljite e-pošto po seznamu   |  Super filter   |   Poseben filter (filter krepko/ležeče/prečrtano ...) ...
15 najboljših kompletov orodij12 Besedilo Orodja (dodajanje besedila, Odstrani znake,...)   |   50 + Graf Vrste (Gantt Chart,...)   |   40+ Praktično Formule (Izračunajte starost glede na rojstni dan,...)   |   19 vstavljanje Orodja (Vstavite kodo QR, Vstavi sliko s poti,...)   |   12 Pretvorba Orodja (Številke v besede, Pretvorba valut,...)   |   7 Spoji in razdeli Orodja (Napredne kombinirane vrstice, Razdeljene celice,...)   |   ... in več

Napolnite svoje Excelove spretnosti s Kutools za Excel in izkusite učinkovitost kot še nikoli prej. Kutools za Excel ponuja več kot 300 naprednih funkcij za povečanje produktivnosti in prihranek časa.  Kliknite tukaj, če želite pridobiti funkcijo, ki jo najbolj potrebujete...

Opis


Kartica Office prinaša vmesnik z zavihki v Office in poenostavi vaše delo

  • Omogočite urejanje in branje z zavihki v Wordu, Excelu, PowerPointu, Publisher, Access, Visio in Project.
  • Odprite in ustvarite več dokumentov v novih zavihkih istega okna in ne v novih oknih.
  • Poveča vašo produktivnost za 50%in vsak dan zmanjša na stotine klikov miške za vas!
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