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

วิธีกำหนดช่วงตามค่าเซลล์อื่นใน Excel

ในการคำนวณช่วงของค่าเป็นเรื่องง่ายสำหรับผู้ใช้ Excel ส่วนใหญ่ แต่คุณเคยพยายามคำนวณช่วงของค่าตามจำนวนในเซลล์ใดเซลล์หนึ่งหรือไม่? ตัวอย่างเช่นมีคอลัมน์ของค่าในคอลัมน์ A และฉันต้องการคำนวณจำนวนค่าในคอลัมน์ A โดยอิงตามค่าใน B2 ซึ่งหมายความว่าถ้าเป็น 4 ใน B2 ฉันจะเฉลี่ย 4 ค่าแรกใน คอลัมน์ A ดังภาพด้านล่างที่แสดง ตอนนี้ฉันแนะนำสูตรง่ายๆในการกำหนดช่วงอย่างรวดเร็วตามค่าเซลล์อื่นใน Excel
doc กำหนดช่วงตามค่าเซลล์ 1

กำหนดช่วงตามค่าของเซลล์


ลูกศรสีฟ้าฟองขวา กำหนดช่วงตามค่าของเซลล์

หากต้องการคำนวณช่วงตามค่าเซลล์อื่นคุณสามารถใช้สูตรง่ายๆ

เลือกเซลล์ว่างที่คุณจะใส่ผลลัพธ์ป้อนสูตรนี้ = ค่าเฉลี่ย (A1: ทางอ้อม (CONCATENATE ("A", B2)))และกด เข้าสู่ กุญแจสำคัญในการรับผลลัพธ์
doc กำหนดช่วงตามค่าเซลล์ 2

หมายเหตุ

1. ในสูตร A1 คือเซลล์แรกในคอลัมน์ที่คุณต้องการคำนวณ A คือคอลัมน์ที่คุณคำนวณหา B2 คือเซลล์ที่คุณคำนวณตาม คุณสามารถเปลี่ยนข้อมูลอ้างอิงเหล่านี้ได้ตามต้องการ

2. หากต้องการสรุปสามารถใช้สูตรนี้ได้ = SUM (A1: ทางอ้อม (CONCATENATE ("A", B2))).

3. หากข้อมูลแรกที่คุณต้องการกำหนดไม่อยู่ในแถวแรกใน Excel เช่นในเซลล์ A2 คุณสามารถใช้สูตรดังนี้: = เฉลี่ย (A2: ทางอ้อม (เชื่อมต่อกัน ("A", ROW (A2) + B2-1))).
doc กำหนดช่วงตามค่าเซลล์ 2


นับ / รวมเซลล์อย่างรวดเร็วตามพื้นหลังหรือจัดรูปแบบสีใน Excel

ในบางกรณีคุณอาจมีช่วงของเซลล์ที่มีหลายสีและสิ่งที่คุณต้องการคือการนับ / รวมค่าตามสีเดียวกันคุณจะคำนวณอย่างรวดเร็วได้อย่างไร?
กับ Kutools สำหรับ Excel's นับตามสีคุณสามารถทำการคำนวณหลายสีได้อย่างรวดเร็วและยังสามารถสร้างรายงานผลการคำนวณได้อีกด้วย  คลิกเพื่อทดลองใช้ฟีเจอร์เต็มรูปแบบฟรีใน 30 วัน!
เอกสารนับตามสี 1
 
Kutools for Excel: มีโปรแกรมเสริม Excel ที่มีประโยชน์มากกว่า 300 รายการให้ทดลองใช้ฟรีโดยไม่มีข้อ จำกัด ใน 30 วัน

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

🤖 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 (21)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
But If I want to sum a column range(say l7:l7800) out of the range d7:ct9000 based on the condition in column a(a7:a9000) and column b(b7:b9000). How will I do it. Please advise
This comment was minimized by the moderator on the site
Is there a way to create a dynamic ranged view, that will isolate all orders from a specific client within a list of clients? I have looked at multiple videos and none actually do what I need it to do. Is there a way to do this or would I need to pull the needed info into a controlled table and use the information from that table?
This comment was minimized by the moderator on the site
Hi, CareTaker. I do not get your question clearly. Could you describe your question or upload a file to show the quetion in details? But I recomend a utility called Data Association for you, maybe can help you, go to this web for details: https://www.extendoffice.com/product/kutools-for-excel/excel-click-cell-to-filter-based-on-another-workbook.html.
This comment was minimized by the moderator on the site
Thank you for the response, its quite the complicated thing to explain but I did manage to come right in the end using the indexing formula with the match formula as well.   =INDEX($B:$B;MATCH($C$2;$B:$B;0);):INDEX($N:$N;MATCH($C$2;$B:$B;0)+$C$3-1;)   at first it was confusing but I'm good now 
This comment was minimized by the moderator on the site
how do I update sum range by using helper cell...For example: if initial sum range is = C1 to M1, how to do change sum range if new data is up to AB1 using a helper cell, instead of changing the formula manually?
This comment was minimized by the moderator on the site
What if the rage is not column, but a row?
This comment was minimized by the moderator on the site
That's a bit trickier as I just found out. You need to use a combination of the CHAR function to convert a number to a letter, CONCAT to piece together a letter and number comprising a cell address, and the INDIRECT function to recognize strings as cell addresses.

In my example, I wrote the following expression:

=SUM(INDIRECT(CONCAT("F",ROW())):INDIRECT(CONCAT(CHAR(64+5+$B$31),ROW())))


where:
Row() is the current row
$B$31 is the cell where the # of columns to count is stored
5 is the offset for the first column to be counted

if you need to go beyond column Z, you’d need a less intuitive variant on that expression using the ADDRESS function:

=SUM(indirect(concat("F",row())):indirect(ADDRESS(row(),$B$31+5,4)))


where:
4 indicates a relative reference
This comment was minimized by the moderator on the site
Hi quick question. My formula =SUMIFS(DATA!$D$5:$D$13914,DATA!$E$5:INDIRECT(CONCATENATE("$E$",C3)),"<"&"1/1/2016") has a range that is from another tab called "DATA." I keep getting #VALUE! errors for this formula. Any suggestions? thanks!
This comment was minimized by the moderator on the site
Earlier I posted: Great formula but why does it only work when referring to the first cell. In other words, if you move the whole range down and the first cell in the range is A5 instead of A1, the formula ceases to work.
After playing with it, I figured out why the formula is not working when the starting row is not row 1. Excel interprets this as the range being A1 thru A4. If you are starting with a different row than row 1, here is how to modify the formula assuming the range now starts with A5:=MAX(A5:INDIRECT(CONCATENATE("A",ROW(A5)+B2)))
This works because the concatenation sees the row reference as fixed in the first example, but it becomes relative in the second example. Hope that helps!
Jared - You can just subtract 4 instead of adding. =MAX(A5:INDIRECT(CONCATENATE("A",ROW(A5)-B2))) [Assuming you have 4 in cell B2, or you could just leave the formula as is and put -4 in cell B2.]
This comment was minimized by the moderator on the site
Hi,cathy, thanks for your supplement, I have test your formula, I think the correct formula may be =MAX(A5:INDIRECT(CONCATENATE("A",ROW(A5)+B2-1))). I have update the tutorual. Thanks again.
This comment was minimized by the moderator on the site
Great formula but why does it only work when referring to the first cell. In other words, if you move the whole range down and the first cell in the range is A6 instead of A1, the formula ceases to work. That seems strange.
This comment was minimized by the moderator on the site
What if I want to count upward from a cell rather than downward? In the above example, the formula starts with A1 and goes downward. Let's say I want a range of 4 cells, beginning with Cell A10 and going to A6. Thank you!
This comment was minimized by the moderator on the site
Jared - See my most recent post for how to solve this.
This comment was minimized by the moderator on the site
I'm having this upward problem also but unable to see your other post for the solution. Can you give me link of the post please? Many thanks!
This comment was minimized by the moderator on the site
Hi, here is a formula may help you to calcualte upward.
=AVERAGE(INDIRECT(CONCATENATE("A",COUNT(A:A)-B1+1)):INDIRECT(CONCATENATE("A",COUNT(A:A))))
A:A is the column that you want to calcualte the average values, B1 is the cell that define the range in column A to calculate.
This comment was minimized by the moderator on the site
Thanks, but may I know why need to use "-B1+1" please?
This comment was minimized by the moderator on the site
Hi, Let me take a detailed example to explain it for you. There are 10 rows in column A, I want to get the last 2 values' average, in other words, average the values in row 9 and row 10. Now B1 contains 2, =COUNT(A:A)-B1+1 will get the result 9, COUNT(A:A) will get the result 10 (the last row of the column A). Now combine other functions to averaget the values in row 9 and row 10. Hope this can help you.
This comment was minimized by the moderator on the site
Can I use this syntax while referring to a different sheet?
This comment was minimized by the moderator on the site
If you want to sum referring to a Different Shet In CONCATENATE formula write [ SHEET NAME+COLUMN+ROW]
Formula=SUM(INDIRECT(CONCATENATE("Sheet1!","D",1)):INDIRECT(CONCATENATE("Sheet1!","D",5)))
This comment was minimized by the moderator on the site
Hi, Thank you so much for your help, but I have a small problem that is I don't have just one column but several ones (about 100 columns) is there a way to change the formula to accommodate the change in columns so O can get the sum for Columns A B C and so on. thanks for your help
This comment was minimized by the moderator on the site
Thank u for your message. If you want to sum first n values across multiple continuous columns, just change A to the last column you ues. EG, sum first 5 values across column A to column D, apply this formula =SUM(A1:INDIRECT(CONCATENATE("D",F2))).
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations