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

วิธีรับหรือส่งคืนส่วนหัวของคอลัมน์ตามค่าแถวเฉพาะใน Excel

ในบทช่วยสอนนี้เราจะค้นหาค่าเฉพาะในแถวของช่วงข้อมูลจากนั้นส่งกลับส่วนหัวคอลัมน์ที่เกี่ยวข้องของเซลล์แถวที่ตรงกัน

รับส่วนหัวของคอลัมน์ตามค่าของแถวที่ระบุด้วยสูตร


รับส่วนหัวของคอลัมน์ตามค่าของแถวที่ระบุด้วยสูตร

สำหรับการรับส่วนหัวของคอลัมน์ตามค่าแถวที่ระบุใน Excel สูตรด้านล่างสามารถช่วยคุณได้

1. เลือกเซลล์ว่างเพื่อส่งออกส่วนหัวคัดลอกสูตรด้านล่างลงในนั้นแล้วกด เข้าสู่ คีย์เพื่อรับส่วนหัวที่เกี่ยวข้อง

=INDEX($C$2:$G$2,SUMPRODUCT(MAX(($C$3:$G$6=I3)*(COLUMN($C$3:$G$6))))-COLUMN($C$2)+1)

หมายเหตุ ในสูตร $ C $ 2: $ G $ 2 คือช่วงส่วนหัว $ C $ 3: $ G $ 6 คือช่วงที่มีค่าเฉพาะที่คุณจะค้นหา I3 คือเซลล์มีค่าเกณฑ์ที่คุณจะจับคู่ในช่วง $ C $ 3: $ G $ 6 และ $ C $ 2 เป็นคอลัมน์แรกของช่วง $ C $ 3: $ G $ 6 โปรดเปลี่ยนตามความต้องการของคุณ


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

ค่า Vlookup และส่งคืนจริงหรือเท็จ / ใช่หรือไม่ใช่ใน Excel
หากต้องการ vlookup ค่าในรายการและแสดงผล True / False หรือ Yes / No สำหรับผลลัพธ์วิธีการในบทความนี้จะช่วยคุณได้

ส่งคืนค่าในเซลล์อื่นหากเซลล์มีข้อความบางอย่างใน Excel
สมมติว่าเซลล์ E6 มีค่า“ ใช่” เซลล์ F6 จะถูกเติมโดยอัตโนมัติด้วยค่า“ อนุมัติ” หากคุณเปลี่ยน“ ใช่” เป็น“ ไม่ใช่” หรือ“ ความเป็นกลาง” ใน E6 ค่าใน F6 จะเปลี่ยนเป็น“ ปฏิเสธ” หรือ“ พิจารณาใหม่” ทันที คุณจะทำอย่างไรเพื่อให้บรรลุ? บทความนี้รวบรวมวิธีการที่มีประโยชน์เพื่อช่วยให้คุณแก้ปัญหาได้อย่างง่ายดาย


เครื่องมือเพิ่มประสิทธิภาพการทำงานในสำนักงานที่ดีที่สุด

Kutools สำหรับ Excel แก้ปัญหาส่วนใหญ่ของคุณและเพิ่มผลผลิตของคุณได้ถึง 80%

  • ซุปเปอร์ฟอร์มูล่าบาร์ (แก้ไขข้อความและสูตรหลายบรรทัดได้อย่างง่ายดาย); การอ่านเค้าโครง (อ่านและแก้ไขเซลล์จำนวนมากได้อย่างง่ายดาย); วางลงในช่วงที่กรองแล้ว...
  • ผสานเซลล์ / แถว / คอลัมน์ และการเก็บรักษาข้อมูล แยกเนื้อหาของเซลล์ รวมแถวที่ซ้ำกันและผลรวม / ค่าเฉลี่ย... ป้องกันเซลล์ซ้ำ; เปรียบเทียบช่วง...
  • เลือกซ้ำหรือไม่ซ้ำ แถว; เลือกแถวว่าง (เซลล์ทั้งหมดว่างเปล่า); Super Find และ Fuzzy Find ในสมุดงานจำนวนมาก สุ่มเลือก ...
  • สำเนาถูกต้อง หลายเซลล์โดยไม่เปลี่ยนการอ้างอิงสูตร สร้างการอ้างอิงอัตโนมัติ ถึงหลายแผ่น ใส่สัญลักษณ์แสดงหัวข้อย่อย, กล่องกาเครื่องหมายและอื่น ๆ ...
  • แทรกสูตรที่ชื่นชอบและรวดเร็ว, ช่วงแผนภูมิและรูปภาพ; เข้ารหัสเซลล์ ด้วยรหัสผ่าน; สร้างรายชื่อผู้รับจดหมาย และส่งอีเมล ...
  • แยกข้อความ, เพิ่มข้อความ, ลบตามตำแหน่ง, ลบ Space; สร้างและพิมพ์ผลรวมย่อยของเพจ แปลงระหว่างเนื้อหาของเซลล์และความคิดเห็น...
  • ซุปเปอร์ฟิลเตอร์ (บันทึกและใช้โครงร่างตัวกรองกับแผ่นงานอื่น ๆ ); การเรียงลำดับขั้นสูง ตามเดือน / สัปดาห์ / วันความถี่และอื่น ๆ ตัวกรองพิเศษ โดยตัวหนาตัวเอียง ...
  • รวมสมุดงานและแผ่นงาน; ผสานตารางตามคอลัมน์สำคัญ แยกข้อมูลออกเป็นหลายแผ่น; Batch แปลง xls, xlsx และ PDF...
  • การจัดกลุ่มตาราง Pivot ตาม จำนวนสัปดาห์วันในสัปดาห์และอื่น ๆ ... แสดงปลดล็อกเซลล์ที่ถูกล็อก ด้วยสีที่ต่างกัน เน้นเซลล์ที่มีสูตร / ชื่อ...
kte แท็บ 201905
  • เปิดใช้งานการแก้ไขและอ่านแบบแท็บใน Word, Excel, PowerPoint, ผู้จัดพิมพ์, Access, Visio และโครงการ
  • เปิดและสร้างเอกสารหลายรายการในแท็บใหม่ของหน้าต่างเดียวกันแทนที่จะเป็นในหน้าต่างใหม่
  • เพิ่มประสิทธิภาพการทำงานของคุณ 50% และลดการคลิกเมาส์หลายร้อยครั้งให้คุณทุกวัน!
ด้านล่าง officetab
Comments (18)
Rated 4.5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
Muito obrigada pelo conteúdo!!! Excelente!
This comment was minimized by the moderator on the site
Muchas gracias por la información y el interés prestado!!
Saludos
This comment was minimized by the moderator on the site
Muchas gracias por todo!!
Una pregunta: ¿Cómo puedo regresar los encabezados de una tabla en una misma celda?
Rated 4.5 out of 5
This comment was minimized by the moderator on the site
Hi Algendar,
Do you mean to search for multiple values and return matching headers in a single cell? If so, simply join the same formula containing different search values in one cell with the Ampersand symbol (&). See the screenshot below.
=INDEX($C$2:$G$2,SUMPRODUCT(MAX(($C$3:$G$6=I3)*(COLUMN($C$3:$G$6))))-COLUMN($C$2)+1) & " " & INDEX($C$2:$G$2,SUMPRODUCT(MAX(($C$3:$G$6=I4)*(COLUMN($C$3:$G$6))))-COLUMN($C$2)+1)
https://www.extendoffice.com/images/stories/comments/comment-picture-zxm/get-header.png
This comment was minimized by the moderator on the site
So say that there will be entries where the values in I3 may not be found, for all of those cells it tries to output every column header in the range giving me a #ref error since it my sheet isnt long enough to accommodate all the titles again, is there any way for it to just output a blank cell in these cases?
This comment was minimized by the moderator on the site
Hi Jerry,
The following formula can do you a favor. Please give it a try.
=IFERROR(INDEX($C$2:$G$2,SUMPRODUCT(MAX(($C$3:$G$6=I3)*(COLUMN($C$3:$G$6))))-COLUMN($C$2)+1),"")
This comment was minimized by the moderator on the site
Hello,
If we have multiple I3 values will it give the second header which has the same value.
If there is anything to do so, please let me know.
This comment was minimized by the moderator on the site
Hi Deepak,
Can you attach a screenshot to describe the problem you encountered more clearly?
This comment was minimized by the moderator on the site
Hello, what if we have missing values ? why does it return the last header ?
Can it be arranged so we don't fill the cell with anything in case it's missing ?
This comment was minimized by the moderator on the site
Hi Mono,
The following formula may help. If no condition is specified, the result will be displayed as null even if there are missing values in the original range.
=IF(I3="", "", INDEX($C$2:$G$2,SUMPRODUCT(MAX(($C$3:$G$6=I3)*(COLUMN($C$3:$G$6))))-COLUMN($C$2)+1))
This comment was minimized by the moderator on the site
How to modify this formula to return specific value if there's no match?
This comment was minimized by the moderator on the site
Amazing. This is very helpful,I was wondering if the value matches more than one header, how to get all headers
This comment was minimized by the moderator on the site
Did you find a solution to this?
This comment was minimized by the moderator on the site
Hi. Awesome example. Any thoughts about if there are duplicate values?
This comment was minimized by the moderator on the site
Hey, were you able to find an answer to this problem ?
The formula here presented is working great for me except this particular matter of having duplicated valuesIs there a way to only take into account the first true value the formula encounters?
This comment was minimized by the moderator on the site
hey, i don't know if there is a way, but something that may be of help is the =Unique command, which counts only the unique data (not replicates of the same data) Hope this helped or what you were looking for :)
This comment was minimized by the moderator on the site
Thank you for this. Very helpful :)
This comment was minimized by the moderator on the site
ur welcome 
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations