Перейти до основного матеріалу

Як отримати або повернути заголовок стовпця на основі конкретного значення рядка в 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 і повернення true або false / так чи ні в Excel
Щоб здійснити пошук значень у списку та відобразити True / False або Yes / No для результату, метод у цій статті зробить вам послугу.

повернути значення в іншій комірці, якщо комірка містить певний текст у Excel
Припустимо, клітинка E6 містить значення "Так", комірка F6 автоматично заповниться значенням "затвердити". Якщо ви змінили значення "Так" на "Ні" або "Нейтральність" в E6, значення в F6 негайно зміниться на "Заборонити" або "Переглянути". Як ви можете досягти цього? У цій статті зібрано кілька корисних методів, які допоможуть вам легко її вирішити.


Найкращі інструменти для підвищення продуктивності офісу

Kutools для Excel вирішує більшість ваших проблем і збільшує продуктивність на 80%

  • Супер формула бар (легко редагувати кілька рядків тексту та формули); Макет читання (легко читати та редагувати велику кількість комірок); Вставте у відфільтрований діапазон...
  • Об’єднати клітинки / рядки / стовпці та Ведення даних; Вміст розділених комірок; Поєднуйте повторювані рядки та суму / середнє... Запобігання дублюючим клітинам; Порівняйте діапазони...
  • Виберіть Повторюваний або Унікальний Рядки; Виберіть Пусті рядки (усі клітинки порожні); Супер знахідка та нечітка знахідка у багатьох робочих зошитах; Випадковий вибір ...
  • Точна копія Кілька клітинок без зміни посилання на формулу; Автоматичне створення посилань на кілька аркушів; Вставте кулі, Прапорці та інше ...
  • Улюблені та швидко вставлені формули, Діапазони, діаграми та зображення; Шифрувати комірки з паролем; Створити список розсилки та надсилати електронні листи ...
  • Витяг тексту, Додати текст, Видалити за позицією, Видаліть пробіл; Створення та друк проміжних підсумків підкачки; Перетворення вмісту комірок та коментарів...
  • Супер фільтр (зберегти та застосувати схеми фільтрів до інших аркушів); Розширене сортування за місяцем / тижнем / днем, частотою та іншим; Спеціальний фільтр жирним, курсивом ...
  • Поєднайте робочі зошити та робочі аркуші; Об’єднати таблиці на основі ключових стовпців; Розділіть дані на кілька аркушів; Пакетне перетворення xls, xlsx та PDF...
  • Групування зведеної таблиці за номер тижня, день тижня та багато іншого ... Показати розблоковані, заблоковані клітини за різними кольорами; Виділіть клітини, які мають формулу / назву...
вкладка kte 201905
  • Увімкніть редагування та читання на вкладках у Word, Excel, PowerPoint, Publisher, Access, Visio та Project.
  • Відкривайте та створюйте кілька документів на нових вкладках того самого вікна, а не в нових вікнах.
  • Збільшує вашу продуктивність на 50% та зменшує сотні клацань миші для вас щодня!
дно офісної таблиці
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