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

วิธีการรวมแถว / คอลัมน์อื่น ๆ หรือที่ n ใน Excel ได้อย่างรวดเร็ว?

อย่างที่เราทราบกันดีว่าเราสามารถใช้ฟังก์ชัน Sum เพื่อเพิ่มรายการเซลล์ได้ แต่บางครั้งเราจำเป็นต้องรวมเซลล์อื่น ๆ ทั้งหมดเพื่อจุดประสงค์บางอย่างและ Excel ไม่มีฟังก์ชันมาตรฐานที่อนุญาตให้เรารวมเซลล์ที่ n ทุกเซลล์ได้ ในสถานการณ์นี้เราจะรวมแถว / คอลัมน์อื่น ๆ หรือที่ n ใน Excel ได้อย่างไร?

รวมแถว / คอลัมน์อื่น ๆ หรือที่ n ด้วยสูตร

รวมแถว / คอลัมน์อื่น ๆ หรือที่ n ด้วยฟังก์ชันที่กำหนดโดยผู้ใช้

รวม / ค่าเฉลี่ย / นับแถว / คอลัมน์อื่น ๆ หรือที่ n ด้วย Kutools for Excel


จากตัวอย่างต่อไปนี้ฉันจะแสดงวิธีใช้สูตรที่รวมเซลล์อื่น ๆ ทั้งหมด

1. ใช้สูตรอาร์เรย์เพื่อรวมแถวหรือคอลัมน์อื่น ๆ

ในเซลล์ว่างโปรดป้อนสูตรนี้: =SUM(IF(MOD(ROW($B$1:$B$15),2)=0,$B$1:$B$15,0)), จากนั้นกด Ctrl + Shift + Enter คีย์และค่าเซลล์อื่น ๆ ทั้งหมดในคอลัมน์ B ได้รับการสรุปแล้ว ดูภาพหน้าจอ:

doc-sum-ever-other-cell1 2 doc-sum-ever-other-cell2

หมายเหตุ:

1. ในสูตรอาร์เรย์ด้านบนคุณสามารถเปลี่ยนหมายเลข 2 เป็น 3, 4, 5 ... ซึ่งหมายถึงผลรวมทุกแถวที่ 3 ทุกแถวที่ 4 ทุกแถวที่ 5 ...

2. ถ้าคุณต้องการรวมทุกคอลัมน์อื่น ๆ คุณสามารถป้อนสูตรต่อไปนี้: =SUM(IF(MOD(COLUMN($A$1:$O$1),2)=0,$A$1:$O$1,0))และกด Ctrl + Shift + Enter กุญแจสำคัญในการรับผลลัพธ์ ดูภาพหน้าจอ:

doc-sum-ever-other-cell3

2. ใช้สูตรเพื่อรวมแถวหรือคอลัมน์อื่น ๆ

นี่คือสูตรอื่นที่สามารถช่วยให้คุณรวมเซลล์อื่น ๆ หรือเซลล์ที่ n ในแผ่นงานได้

ในเซลล์ว่างโปรดป้อนสูตรนี้: =SUMPRODUCT((MOD(ROW($B$1:$B$15),3)=0)*($B$1:$B$15)). จากนั้นกด เข้าสู่ คีย์และเพิ่มทุกเซลล์ที่ 3 ดูภาพหน้าจอ:

doc-sum-ever-other-cell4 2 doc-sum-ever-other-cell5

หมายเหตุ:

1. ในสูตรข้างต้นคุณสามารถเปลี่ยนตัวเลข 3 เป็น 4, 5, 6 ... หมายถึงผลรวมทุกแถวที่ 4 ทุกแถวที่ 5 ทุกแถวที่ 6 ...

2. ถ้าคุณต้องการรวมทุกคอลัมน์อื่น ๆ คุณสามารถป้อนสูตรต่อไปนี้: =SUMPRODUCT((MOD(COLUMN($A$1:$O$1),3)=0)*($A$1:$O$1)).

doc-sum-ever-other-cell6


ฟังก์ชันที่ผู้ใช้กำหนดต่อไปนี้ยังสามารถช่วยคุณเพิ่มเซลล์อื่น ๆ หรือเซลล์ที่ n ใน Excel

1. กด ALT + F11 และจะเปิดไฟล์ Microsoft Visual Basic สำหรับแอปพลิเคชัน หน้าต่าง

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

Function SumIntervalRows(WorkRng As Range, interval As Integer) As Double
'Updateby Extendoffice
Dim arr As Variant
Dim total As Double
total = 0
arr = WorkRng.Value
For i = interval To UBound(arr, 1) Step interval
    total = total + arr(i, 1)
Next
SumIntervalRows = total
End Function
Function SumIntervalCols(WorkRng As Range, interval As Integer) As Double
Dim arr As Variant
Dim total As Double
total = 0
arr = WorkRng.Value
For j = interval To UBound(arr, 2) Step interval
    total = total + arr(1, j)
Next
SumIntervalCols = total
End Function

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

สำหรับการรวมทุกแถวที่สี่: = SumIntervalRows (B1: B15,4)

doc-sum-ever-other-cell7

สำหรับการสรุปทุกคอลัมน์ที่สี่: = SumIntervalCols (A1: O1,4)

doc-sum-ever-other-cell8

4. จากนั้นกด เข้าสู่ คุณจะได้รับการคำนวณ ดูภาพหน้าจอ:

รวมทุกแถวที่สี่:

doc-sum-ever-other-cell9

รวมทุกคอลัมน์ที่สี่:

doc-sum-ever-other-cell10

หมายเหตุ: คุณสามารถเปลี่ยนหมายเลข 4 เป็นตัวเลขอื่น ๆ เช่น 2, 3, 5 …หมายถึงผลรวมทุกแถวที่สองทุกแถวที่สามทุกแถวหรือคอลัมน์ที่ห้า


บางทีทั้งสูตรและฟังก์ชันที่ผู้ใช้กำหนดจะค่อนข้างยากสำหรับคุณส่วนใหญ่ที่นี่ฉันขอแนะนำวิธีที่ง่ายกว่าในการแก้ปัญหานี้ให้คุณ

กับ Kutools สำหรับ Excel's เลือก Interval Rows & Columnsคุณสามารถเลือกเซลล์อื่น ๆ หรือเซลล์ที่ n ที่คุณต้องการก่อนจากนั้นตั้งชื่อเซลล์ที่เลือกไว้ในที่สุดโดยใช้ฟังก์ชัน Sum เพื่อรวมเซลล์

Kutools สำหรับ Excel : ด้วย Add-in ของ Excel ที่มีประโยชน์มากกว่า 300 รายการทดลองใช้ฟรีโดยไม่มีข้อ จำกัด ใน 30 วัน. 

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

1. เลือกคอลัมน์ที่คุณต้องการรวมเซลล์อื่น ๆ หรือเซลล์ที่ n

2. คลิก Kutools > เลือก > เลือก Interval Rows & Columnsดูภาพหน้าจอ:

3. ใน เลือก Interval Rows & Columns กล่องโต้ตอบระบุการดำเนินการตามที่คุณต้องการดูภาพหน้าจอ:

doc-sum-ever-other-cell12

4. คลิก OKและทุกแถวอื่น ๆ ได้ถูกเลือกจากแถวแรกและตอนนี้คุณสามารถดูผลลัพธ์จากการคำนวณเช่นค่าเฉลี่ยผลรวมจำนวนจะแสดงที่ด้านล่างของแถบสถานะ ดูภาพหน้าจอ:

doc-sum-ever-other-cell13

หมายเหตุ:

1. ด้วยฟังก์ชั่นนี้คุณสามารถตั้งค่าหมายเลข 2, 3, 4 ... ช่วงเวลาของ และคุณจะเลือกเซลล์ที่มีช่วงเวลา 2, 3, 4 แถวโดยเริ่มจากแถวแรกของช่วงในขั้นตอนที่ 3

2. ด้วยขั้นตอนข้างต้นคุณสามารถรวมคอลัมน์อื่น ๆ หรือคอลัมน์ที่ n ได้ตามที่คุณต้องการ

หากคุณต้องการทราบข้อมูลเพิ่มเติมเกี่ยวกับคุณลักษณะนี้โปรดคลิก เลือก Interval Rows & Columns.

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


Kutools สำหรับ Excel: ด้วย Add-in ของ Excel ที่มีประโยชน์มากกว่า 300 รายการให้ทดลองใช้ฟรีโดยไม่มีข้อ จำกัด ใน 30 วัน ดาวน์โหลดและทดลองใช้ฟรีทันที!

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

วิธีการรวมเฉพาะเซลล์ที่กรองหรือมองเห็นได้ใน Excel

วิธีการรวมค่าสัมบูรณ์ใน 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 (20)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
the above given codes work but when the file is closed and reopen, it doesn't work. again the same codes needs to copy and paste. pls give permanent solution
This comment was minimized by the moderator on the site
Hello,
After pasting the code, when you close the workbook, you should save the workbook as Excel Macro-Enabled Workbook format to save the code.
When you open the workbook next time, click the Enable Content button in the security warning bar.
Please try, thank you!
This comment was minimized by the moderator on the site
Hi i want to sum up every 4 row, but my new table for these sum-up values has an interval of every 12 rows, any idea?
Ex: Sum-up every 4 months data and put those data in a new table at every new year Jan (12 interval row).
This comment was minimized by the moderator on the site
Sorry final question is there a way this can be done in one array in a Sumproduct formula as I'd like the values to still be kept individually.
This comment was minimized by the moderator on the site
That VBA code is helpful, can it be amended so it also sums the first value of the sequence?
This comment was minimized by the moderator on the site
These vma tutorials are the best thing ever. Very helpful thank you guys!
This comment was minimized by the moderator on the site
The formula is not working for the column can anyone please help me to add odd column
This comment was minimized by the moderator on the site
Hi, Nilesh,
If you want to sum the cell values in all odd row, the below formula may help you! (Please change the cell references to your need.)

=SUMPRODUCT(B1:B15,MOD(ROW(B1:B15)+0,2))

Please try, hope it can help you!
This comment was minimized by the moderator on the site
Is there a way to add another criteria to this formula? I want to add every 9th row that is great than -40. I would appreciate your help. Thanks in advance!
This comment was minimized by the moderator on the site
Used the visual basic programming – excellent! The other options worked fine except for row n.º 1.
This comment was minimized by the moderator on the site
sir I have used visual basic for SumIntervalCols function as stated above and saved the file as macro enable worksheet. when next time open the file the user define command is missing from drop down function menu Please help how to fix user define macro and can be used for other excel sheets. regards D KUMAR
This comment was minimized by the moderator on the site
This method does not work for me. I entered the 15 numbers in the column B (B1:B15) as in the example and copy the formula to a blank cell, the result is 0. If I change the if statement to IF(MOD(ROW($B$1:$B$15),2)=1, the result is 3795 that is sum(B1:B15). What is wrong?
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