ไปยังเนื้อหาหลัก

วิธีการรวมตัวเลขทั้งหมดในตัวเลขใน Excel

หากคุณมีเซลล์ที่มีค่าและตอนนี้คุณต้องการเพิ่มตัวเลขทั้งหมดเข้าด้วยกันของเซลล์ ตัวอย่างเช่นหากคุณมีค่า 12345 ในเซลล์คุณต้องการคำนวณตามนี้: 1 + 2 + 3 + 4 + 5 และรับค่า 15 มีวิธีใดที่ดีสำหรับคุณในการรวมตัวเลขทั้งหมดของตัวเลข ใน Excel?


รวมตัวเลขทั้งหมดในเซลล์ด้วยสูตร

โดยไม่ต้องเพิ่มตัวเลขทีละหลักด้วยตนเองสูตรต่อไปนี้สามารถช่วยให้คุณได้ผลรวมของเซลล์อย่างรวดเร็ว

1. โปรดป้อนหรือคัดลอกสูตรใดสูตรหนึ่งต่อไปนี้ลงในเซลล์ว่างเพื่อแสดงผลลัพธ์:

=SUMPRODUCT(1*MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1))
=SUM(INDEX(1*(MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1)),,))

2. จากนั้นกด เข้าสู่ เพื่อส่งคืนผลลัพธ์และเลือกเซลล์ C2 จากนั้นลากจุดจับเติมไปยังช่วงที่คุณต้องการใช้สูตรนี้และคุณจะได้รับผลรวมของตัวเลขของแต่ละเซลล์ดูภาพหน้าจอ:

หมายเหตุ / รายละเอียดเพิ่มเติม:

  • ในสูตรข้างต้น A2 คือเซลล์มีตัวเลขที่คุณต้องการรวมตัวเลข
  • หากมีเครื่องหมายลบหรือจุดทศนิยมในตัวเลขสูตรจะส่งกลับ #VALUE! ข้อผิดพลาด

รวมหลักทั้งหมดของตัวเลขในเซลล์ด้วย User Defined Function

หากต้องการเพิ่มตัวเลขทั้งหมดของเซลล์รหัส VBA ต่อไปนี้สามารถช่วยคุณได้

1. กด ALT + F11 และจะเปิดไฟล์ หน้าต่าง Microsoft Visual Basic for Applications.

2. คลิก สิ่งที่ใส่เข้าไป > โมดูลและวางรหัสต่อไปนี้ในไฟล์ หน้าต่างโมดูล.

รหัส VBA: รวมตัวเลขทั้งหมดของจำนวนเซลล์

 Function SumDigits(Number As String) As Integer
'Updateby Extendoffice
Dim x As Integer, C As String
For x = 1 To Len(Number)
C = Mid(Number, x, 1)
If IsNumeric(C) Then SumDigits = SumDigits + C
Next
End Function

3. จากนั้นบันทึกและปิดรหัสนี้กลับไปที่แผ่นงานและป้อนสูตรนี้ = SumDigits (A2) ลงในเซลล์ว่างจากนั้นลากที่จับเติมลงไปที่เซลล์ที่คุณต้องการให้มีสูตรนี้คุณจะได้ผลลัพธ์ดังต่อไปนี้:


รวมตัวเลขทั้งหมดในเซลล์ด้วยคุณสมบัติที่ง่าย

ที่นี่ฉันสามารถพูดคุยเกี่ยวกับเครื่องมือที่มีประโยชน์ - Kutools สำหรับ Excelเดียวกันกับที่ รวมตัวเลขในเซลล์ คุณสามารถเพิ่มตัวเลขทั้งหมดภายในตัวเลขได้อย่างรวดเร็ว

หมายเหตุที่จะใช้สิ่งนี้ รวมตัวเลขในเซลล์ประการแรกคุณควรดาวน์โหลดไฟล์ Kutools สำหรับ Excelแล้วใช้คุณสมบัตินี้อย่างรวดเร็วและง่ายดาย

หลังจากการติดตั้ง Kutools สำหรับ Excelโปรดทำตามนี้:

1. คลิกเซลล์ว่างที่คุณต้องการให้ผลลัพธ์ออกมา

2. จากนั้นคลิก Kutools > ตัวช่วยสูตร > ตัวช่วยสูตรดูภาพหน้าจอ:

3. ใน ตัวช่วยสูตร ไดอะล็อกบ็อกซ์ให้ดำเนินการดังต่อไปนี้:

  • เลือก คณิตศาสตร์ ตัวเลือกจาก สูตร ชนิดภาพเขียน รายการแบบหล่นลง
  • จากนั้นเลือก รวมตัวเลขในเซลล์ จาก เลือก fromula กล่องรายการ;
  • ทางด้านขวา การป้อนอาร์กิวเมนต์ เลือกเซลล์ที่คุณต้องการรวมหลัก

4. จากนั้นคลิก Ok แล้วลากจุดจับเติมไปยังเซลล์ที่คุณต้องการรวมตัวเลขในเซลล์ และมีการเพิ่มตัวเลขทั้งหมดในแต่ละเซลล์เข้าด้วยกันดูภาพหน้าจอ:

ดาวน์โหลดและทดลองใช้ Kutools for Excel ฟรีทันที!


บทความที่เกี่ยวข้องเพิ่มเติม:

  • ผลรวมเส้นทแยงมุมของช่วงใน Excel
  • เมื่อคุณคำนวณเลขคณิตคุณอาจต้องรวมตัวเลขในแนวทแยงมุมในตาราง ในความเป็นจริงคุณยังสามารถรวมตัวเลขแนวทแยงใน Excel ซึ่งไม่ต้องการให้คุณรวมตัวเลขทีละตัว หากคุณต้องการทราบข้อมูลเพิ่มเติมเกี่ยวกับคำถามนี้โปรดอ่านบทความต่อไปนี้
  • รวมแถวที่ซ้ำกันและรวมค่า
  • ใน Excel, คุณอาจพบปัญหานี้เสมอเมื่อคุณมีช่วงของข้อมูลที่มีรายการที่ซ้ำกันและตอนนี้คุณต้องการรวมข้อมูลที่ซ้ำกันและรวมค่าที่เกี่ยวข้องในคอลัมน์อื่นดังที่แสดงภาพหน้าจอต่อไปนี้ คุณจะแก้ปัญหานี้ได้อย่างไร?
  • ผลรวมตามเกณฑ์คอลัมน์และแถว
  • ฉันมีช่วงข้อมูลที่มีส่วนหัวของแถวและคอลัมน์ตอนนี้ฉันต้องการหาผลรวมของเซลล์ที่ตรงตามเกณฑ์ส่วนหัวของคอลัมน์และแถว ตัวอย่างเช่นเพื่อรวมเซลล์ที่เกณฑ์ของคอลัมน์เป็น Tom และเกณฑ์ของแถวคือ Feb ดังภาพหน้าจอต่อไปนี้ บทความนี้ผมจะพูดถึงสูตรที่มีประโยชน์ในการแก้ปัญหา
  • รวมตัวเลขตั้งแต่ 1 ถึง N ใน Excel
  • สำหรับผู้ใช้ Excel ส่วนใหญ่บางครั้งคุณต้องลบอักขระ n ตัวแรกจากจุดเริ่มต้นของสตริงข้อความหรือลบอักขระ x ตัวสุดท้ายออกจากท้ายสตริงข้อความดังภาพด้านล่างที่แสดง บทความนี้ฉันจะแนะนำเทคนิคที่มีประโยชน์สำหรับการแก้ปัญหานี้อย่างรวดเร็วและง่ายดายใน Excel

สุดยอดเครื่องมือเพิ่มผลผลิตในสำนักงาน

🤖 Kutools AI ผู้ช่วย: ปฏิวัติการวิเคราะห์ข้อมูลโดยยึดตาม: การดำเนินการที่ชาญฉลาด   |  สร้างรหัส  |  สร้างสูตรที่กำหนดเอง  |  วิเคราะห์ข้อมูลและสร้างแผนภูมิ  |  เรียกใช้ฟังก์ชัน Kutools...
คุณสมบัติยอดนิยม: ค้นหา เน้น หรือระบุรายการที่ซ้ำกัน   |  ลบแถวว่าง   |  รวมคอลัมน์หรือเซลล์โดยไม่สูญเสียข้อมูล   |   รอบโดยไม่มีสูตร ...
การค้นหาขั้นสูง: VLookup หลายเกณฑ์    VLookup หลายค่า  |   VLookup ข้ามหลายแผ่น   |   การค้นหาที่ไม่ชัดเจน ....
รายการแบบเลื่อนลงขั้นสูง: สร้างรายการแบบหล่นลงอย่างรวดเร็ว   |  รายการแบบหล่นลงขึ้นอยู่กับ   |  เลือกหลายรายการแบบหล่นลง ....
ผู้จัดการคอลัมน์: เพิ่มจำนวนคอลัมน์เฉพาะ  |  ย้ายคอลัมน์  |  สลับสถานะการมองเห็นของคอลัมน์ที่ซ่อนอยู่  |  เปรียบเทียบช่วงและคอลัมน์ ...
คุณสมบัติเด่น: กริดโฟกัส   |  มุมมองการออกแบบ   |   บาร์สูตรใหญ่    สมุดงานและตัวจัดการชีต   |  ห้องสมุดทรัพยากร (ข้อความอัตโนมัติ)   |  เลือกวันที่   |  รวมแผ่นงาน   |  เข้ารหัส/ถอดรหัสเซลล์    ส่งอีเมลตามรายการ   |  ซุปเปอร์ฟิลเตอร์   |   ตัวกรองพิเศษ (กรองตัวหนา/ตัวเอียง/ขีดทับ...) ...
ชุดเครื่องมือ 15 อันดับแรก12 ข้อความ เครื่องมือ (เพิ่มข้อความ, ลบอักขระ, ... )   |   50 + แผนภูมิ ประเภท (แผนภูมิ Gantt, ... )   |   40+ ใช้งานได้จริง สูตร (คำนวณอายุตามวันเกิด, ... )   |   19 การแทรก เครื่องมือ (ใส่ QR Code, แทรกรูปภาพจากเส้นทาง, ... )   |   12 การแปลง เครื่องมือ (ตัวเลขเป็นคำ, การแปลงสกุลเงิน, ... )   |   7 ผสานและแยก เครื่องมือ (แถวรวมขั้นสูง, แยกเซลล์, ... )   |   ... และอื่น ๆ

เพิ่มพูนทักษะ Excel ของคุณด้วย Kutools สำหรับ Excel และสัมผัสประสิทธิภาพอย่างที่ไม่เคยมีมาก่อน Kutools สำหรับ Excel เสนอคุณสมบัติขั้นสูงมากกว่า 300 รายการเพื่อเพิ่มประสิทธิภาพและประหยัดเวลา  คลิกที่นี่เพื่อรับคุณสมบัติที่คุณต้องการมากที่สุด...

รายละเอียด


แท็บ Office นำอินเทอร์เฟซแบบแท็บมาที่ Office และทำให้งานของคุณง่ายขึ้นมาก

  • เปิดใช้งานการแก้ไขและอ่านแบบแท็บใน Word, Excel, PowerPoint, ผู้จัดพิมพ์, Access, Visio และโครงการ
  • เปิดและสร้างเอกสารหลายรายการในแท็บใหม่ของหน้าต่างเดียวกันแทนที่จะเป็นในหน้าต่างใหม่
  • เพิ่มประสิทธิภาพการทำงานของคุณ 50% และลดการคลิกเมาส์หลายร้อยครั้งให้คุณทุกวัน!
Comments (26)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Bonjour,
Je cherchais justement cette solution c.à.d. comment faire la somme des chiffres d'un nombre (de 4 chiffres) sur excel et je suis tombé sur ce site. Je suis en profonde admiration devant l'intelligence de certains qui ont trouvé des formules de ouf. Malheureusement, je ne suis pas à ce niveau pour les mettre en pratique. Je me suis dit (car j'aime me parler, comme ça, j'ai toujours raison LOL) que pourquoi chercher compliqué quand on peut faire plus simple et j'ai trouvé une solution qui n'est pas élégante (OK je ne suis pas Einstein) et qui marche. Que veut on de plus ! Je vous la donne ici.
Je prends un exemple avec un nombre à 4 chiffres mais vous pouvez ajouter autant de chiffres que vous voulez. Disons que ce nombre est dans la cellule A2 pour l'exemple :
=STXT($A$2;1;1)+STXT($A$2;2;1)+STXT($A$2;3;1)+STXT($A$2;4;1)
J'ai mis des $ pour pouvoir copier plus facilement et ensuite je n'ai qu'à changer le rang du chiffre, dans mon cas 1, 2, 3, 4 et vous pouvez allez aussi loin que vous voulez
En anglais, vous remplacez STXT par MID et en allemand par TEIL
Si vous voulez la somme du résultat (dans la cellule A3 par ex.), vous faites la même chose en remplaçant A2 par A3.
Voila
Julien
This comment was minimized by the moderator on the site
Já procurei mais não acho por nada eu queira fazer uma planilha que o resultado da soma final reduz o número a 1 dígito. Por exemplo o resultado deu 7+6=13 e ele virasse 1+3= 4
This comment was minimized by the moderator on the site
I want to two digits like: 11.03 and 1.11, so i want to answer is coming 13.02.kindly provide a formula.
This comment was minimized by the moderator on the site
I play KillerSudoku: If I have n number of sums (not the total or answer) but I have say 2 or 3 or more empty cells with number possibilities who's sum totals 15; say, the total is 15 and I have 4 empty squares that all live in the same cage (meaning non-repeating), how do I show all possible sums: ie, 2+3+6+4, or 3+5+1+6, or 3+4+6+1 and so on. Also, I need to sometimes show all possible sums with repeating. Can this be done in Excel
This comment was minimized by the moderator on the site
Hello, Kevin,Maybe the following article can do you a favor:https://www.extendoffice.com/documents/excel/3557-excel-find-all-combinations-that-equal-given-sum.html
Please try, thank you!
This comment was minimized by the moderator on the site
Hello Experts. I have a question. For instance i have 18487.73486. I want a cell to sum 18487 and another cell that would sum the 73486. How do I go about doing it? Will appreciate any response. tia
This comment was minimized by the moderator on the site
Your Solution or the Formula is excellent. Thanks for the quick fix .
This comment was minimized by the moderator on the site
I typed 3 zero in 2nd column and put sum formula i.e. 50 in 1st column and three zero in 2nd column but excel is not working because the zero are going to remove automatically. Could you please help me.
This comment was minimized by the moderator on the site
Hello, Murtuza,
Sorry, I don't get your point, please give more detailed information about your problem, or you can insert a screenshot here.
Thank you!
This comment was minimized by the moderator on the site
How to count number in a cell in excel i.e. for example : 1+1+2+3+4+5+6+7 = 8
This comment was minimized by the moderator on the site
Hi,
Maybe the below article can solve your problem, please check it:
https://www.extendoffice.com/documents/excel/1504-excel-count-letters-in-cell.html
Hope it can help you!
This comment was minimized by the moderator on the site
Thank you so much
This comment was minimized by the moderator on the site
I am trying to find the avg of multipule numbers in a cell, lets say 22,11,18,14,3,6 are all in the same cell is there a way for another cell to display 12.3?
This comment was minimized by the moderator on the site
Hello, john,
To calculate the average of multiple numbers within a cell, please apply the below formula:
=IF(A1="","",ROUND(SUMPRODUCT(--(0&TRIM(MID(SUBSTITUTE(A1,",",REPT(" ",99)),ROW($1:$99)*99-98,99))))/(LEN(A1)-LEN(SUBSTITUTE(A1,",",))+1),2))
Note: the last number 2 in the formula indicates that retain two decimal places after rounding. You can change it to your need.

Please try it, hope it can help you!
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