Přejít k hlavnímu obsahu

Jak získat nebo vrátit záhlaví sloupce na základě konkrétní hodnoty řádku v aplikaci Excel?

Autor: Siluvia Naposledy změněno: 2019-08-05

V tomto kurzu vyhledáme konkrétní hodnotu v řádcích datového rozsahu a poté vrátíme odpovídající záhlaví sloupce odpovídající buňky řádku.

Získejte záhlaví sloupce na základě konkrétní hodnoty řádku pomocí vzorce


Získejte záhlaví sloupce na základě konkrétní hodnoty řádku pomocí vzorce

Pro získání záhlaví sloupce na základě konkrétní hodnoty řádku v aplikaci Excel vám může pomoci následující vzorec.

1. Vyberte prázdnou buňku pro výstup záhlaví, zkopírujte do ní následující vzorec a stiskněte vstoupit klíč k získání odpovídající hlavičky.

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

Poznámka: Ve vzorci, $ C $ 2: $ G $ 2 je rozsah záhlaví, $ C $ 3: $ G $ 6 je rozsah obsahuje konkrétní hodnotu, ve které budete hledat, I3 je buňka obsahující hodnotu kritéria, které budete odpovídat v rozsahu $ C $ 3: $ G $ 6, a $ C $ 2 je první sloupec rozsahu $ C $ 3: $ G $ 6. Změňte je prosím podle svých potřeb.


Související články

Vlookup hodnotu a vrátit true nebo false / ano nebo ne v aplikaci Excel
Chcete-li vlookup hodnoty v seznamu a zobrazit výsledek True / False nebo Yes / No, způsob v tomto článku vám udělá laskavost.

vrátit hodnotu v jiné buňce, pokud buňka obsahuje určitý text v aplikaci Excel
Předpokládejme, že buňka E6 obsahuje hodnotu „Ano“, buňka F6 se automaticky naplní hodnotou „schválit“. Pokud jste v E6 změnili „Ano“ na „Ne“ nebo „Neutralita“, hodnota ve F6 se okamžitě změní na „Odepřít“ nebo „Přehodnotit“. Jak můžete toho dosáhnout? Tento článek shrnuje několik užitečných metod, které vám pomohou jej snadno vyřešit.


  • Super Formula Bar (snadno upravit více řádků textu a vzorce); Rozložení pro čtení (snadno číst a upravovat velké množství buněk); Vložit do filtrovaného rozsahu...
  • Sloučit buňky / řádky / sloupce a uchovávání údajů; Rozdělit obsah buněk; Zkombinujte duplicitní řádky a součet / průměr... Zabraňte duplicitním buňkám; Porovnat rozsahy...
  • Vyberte možnost Duplikovat nebo Jedinečný Řádky; Vyberte prázdné řádky (všechny buňky jsou prázdné); Super hledání a fuzzy hledání v mnoha sešitech; Náhodný výběr ...
  • Přesná kopie Více buněk beze změny odkazu na vzorec; Automaticky vytvářet reference do více listů; Vložte odrážky, Zaškrtávací políčka a další ...
  • Oblíbené a rychlé vkládání vzorců„Rozsahy, grafy a obrázky; Šifrovat buňky s heslem; Vytvořte seznam adresátů a posílat e-maily ...
  • Extrahujte text, Přidat text, Odebrat podle pozice, Odebrat mezeru; Vytváření a tisk mezisoučtů stránkování; Převod mezi obsahem buněk a komentáři...
  • Super filtr (uložit a použít schémata filtrů na jiné listy); Rozšířené řazení podle měsíce / týdne / dne, frekvence a dalších; Speciální filtr tučnou kurzívou ...
  • Kombinujte sešity a pracovní listy; Sloučit tabulky na základě klíčových sloupců; Rozdělte data do více listů; Dávkový převod xls, xlsx a PDF...
  • Seskupování kontingenčních tabulek podle číslo týdne, den v týdnu a další ... Zobrazit odemčené, zamčené buňky různými barvami; Zvýrazněte buňky, které mají vzorec / název...
karta kte 201905
  • Povolte úpravy a čtení na kartách ve Wordu, Excelu, PowerPointu, Publisher, Access, Visio a Project.
  • Otevřete a vytvořte více dokumentů na nových kartách ve stejném okně, nikoli v nových oknech.
  • Zvyšuje vaši produktivitu o 50%a snižuje stovky kliknutí myší každý den!
officetab dno
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