메인 컨텐츠로 가기

XNUMX이 아닌 첫 번째 값을 조회하고 Excel에서 해당 열 머리글을 반환하는 방법은 무엇입니까?

데이터 범위가 있다고 가정하면 다음 스크린 샷과 같이 XNUMX이 아닌 첫 번째 값이 발생하는 해당 행의 열 머리글을 반환하려고합니다.이 기사에서는이 작업을 처리하는 데 유용한 공식을 소개합니다. Excel에서.

문서 조회 먼저 1이 아닌 XNUMX

XNUMX이 아닌 첫 번째 값을 조회하고 수식을 사용하여 해당 열 머리글을 반환합니다.


화살표 블루 오른쪽 거품 XNUMX이 아닌 첫 번째 값을 조회하고 수식을 사용하여 해당 열 머리글을 반환합니다.

행에서 XNUMX이 아닌 첫 번째 값의 열 머리글을 반환하려면 다음 수식이 도움이 될 수 있습니다. 다음과 같이하십시오.

다음 공식을 입력하십시오. =INDEX($B$1:$I$1,MATCH(TRUE,INDEX(B2:I2<>0,),0)) 결과를 찾으려는 빈 셀에 K2예를 들어, 채우기 핸들을이 수식을 적용 할 셀로 드래그하면 다음 스크린 샷과 같이 XNUMX이 아닌 첫 번째 값의 모든 해당 열 머리글이 반환됩니다.

문서 조회 먼저 2이 아닌 XNUMX

주의 사항: 위의 공식에서 B1 : I1 반환하려는 열 헤더입니다. B2 : I2 XNUMX이 아닌 첫 번째 값을 조회하려는 행 데이터입니다.

최고의 사무 생산성 도구

🤖 Kutools AI 보좌관: 다음을 기반으로 데이터 분석을 혁신합니다. 지능형 실행   |  코드 생성  |  사용자 정의 수식 만들기  |  데이터 분석 및 차트 생성  |  Kutools 기능 호출...
인기 기능: 중복 항목 찾기, 강조 표시 또는 식별   |  빈 행 삭제   |  데이터 손실 없이 열이나 셀 결합   |   수식없이 반올림 ...
슈퍼 조회: 다중 기준 VLookup    다중 값 VLookup  |   여러 시트에 걸친 VLookup   |   퍼지 조회 ....
고급 드롭다운 목록: 드롭다운 목록을 빠르게 생성   |  종속 드롭다운 목록   |  다중 선택 드롭 다운 목록 ....
열 관리자: 특정 개수의 열 추가  |  열 이동  |  Toggle 숨겨진 열의 가시성 상태  |  범위 및 열 비교 ...
특색 지어진 특징: 그리드 포커스   |  디자인보기   |   큰 수식 바    통합 문서 및 시트 관리자   |  리소스 라이브러리 (자동 텍스트)   |  날짜 선택기   |  워크 시트 결합   |  셀 암호화/해독    목록으로 이메일 보내기   |  슈퍼 필터   |   특수 필터 (굵게/기울임꼴/취소선 필터링...) ...
상위 15개 도구 세트12 본문 도구 (텍스트 추가, 문자 제거,...)   |   50+ 거래차트 유형 (Gantt 차트,...)   |   40+ 실용 방식 (생일을 기준으로 나이 계산,...)   |   19 삽입 도구 (QR 코드 삽입, 경로에서 그림 삽입,...)   |   12 매출 상승 도구 (숫자를 단어로, 환율,...)   |   7 병합 및 분할 도구 (고급 결합 행, 셀 분할,...)   |   ... 그리고 더

Excel용 Kutools로 Excel 기술을 강화하고 이전과는 전혀 다른 효율성을 경험해 보세요. Excel용 Kutools는 생산성을 높이고 시간을 절약하기 위해 300개 이상의 고급 기능을 제공합니다.  가장 필요한 기능을 얻으려면 여기를 클릭하십시오...

상품 설명


Office Tab은 Office에 탭 인터페이스를 제공하여 작업을 훨씬 쉽게 만듭니다.

  • Word, Excel, PowerPoint에서 탭 편집 및 읽기 사용, Publisher, Access, Visio 및 Project.
  • 새 창이 아닌 동일한 창의 새 탭에서 여러 문서를 열고 만듭니다.
  • 생산성을 50% 높이고 매일 수백 번의 마우스 클릭을 줄입니다!
Comments (15)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hello, my problem is: a have value 1,2,3,4,...50 that are the number of month. How to denormalize month into real datum. Thank you in advance a lot!!!
This comment was minimized by the moderator on the site
Does anyone know what you would do if your cell that contains a zero has a formula in it? When I use this formula, I end up with whatever the first column header is regardless of whether it is zero or not.
This comment was minimized by the moderator on the site
E como faço pra procurar o primeiro valor diferente de zero da esquerda pra direita?
This comment was minimized by the moderator on the site
Hello, Matheus
If you want to return the first non-zero value from a row, please apply the below formula:
=INDEX(B2:F2,MATCH(TRUE,INDEX(B2:F2<>0,),0))
Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
What if you needed the last non-zero value in an array?

P.S. This was really helpful, thank you so much!
This comment was minimized by the moderator on the site
Hello, Ali,
To get the column header based on the last non-zero value, please apply the below formula, see screenshot:
=INDEX($B$1:$H$1,MAX((COLUMN(B2:H2)-MIN(COLUMN(B2:H2))+1)*(B2:H2<>0)))
Please remember to press Ctrl+Shift+Enter key together.
https://www.extendoffice.com/images/stories/comments/comment-skyyang/doc-last-non-zero.png
Please try, hope it can help you!
This comment was minimized by the moderator on the site
The formula is super helpful and helped me sorted out the situation! Thanks!!! Is there any chance you may please help to also explain how it works?
This comment was minimized by the moderator on the site
How do you look up for the second,third and fourth non-zero value?
This comment was minimized by the moderator on the site
Hello, Robert,
To lookup the second, third or fourth non-zero values and return their columns, please apply the below formula: (After pasting the formula, please press Ctr + Shift + Enter keys together.)
=INDEX($B$1:$I$1,SMALL(IF(B2:I2<>0, COLUMN(B2:I2)-COLUMN(A2)),2))


Note: To extract the third or fourth result, you just need to change the number 2 to 3,4 as you need.

Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
CAN U EXPLIAN HOW THIS FORMULA WORKS
This comment was minimized by the moderator on the site
Hello Priya,I am glad to help. I will separate the formula = INDEX($B$1:$I$1,MATCH(TRUE,INDEX(B2:I2<>0,),0)) into 3 parts, and explain the formula to you step by step.
First, let us see the inner-most formula =INDEX(B2:I2<>0,). This formula returns an array of TRUE and FALSE whether the values of range B2:I2 are equal to 0. Please see the screenshot 1, formula =INDEX(B2:I2<>0,) returns {FALSE,FALSE,FALSE,FALSE,TRUE,TRUE,TRUE,TRUE}.
Second, =MATCH(TRUE,INDEX(B2:I2<>0,),0) =MATCH(TRUE, {FALSE,FALSE,FALSE,FALSE,TRUE,TRUE,TRUE,TRUE}, 0). It returns the position of the first value "TRUE", while 0 in the formula means an exact match. We can see that the first value "TRUE" occurs at the 5th position of the array. Then the second formula returns 5. See the screenshot 2.
Finally,  =INDEX(B1:I1,MATCH(TRUE,INDEX(B2:I2<>0,),0))=INDEX(B1:I1,5). It returns the 5th value of the array B1:I1. We can see in the screenshot that the value is "May". So the final formula returns "May". 
PS: To drag the fill handle down the formula to get the rest of the results, we must make the range B1:I1 absolute. So we add $ to range B1:I1 to keep it absolute. 
Hope my explanation can solve your puzzle. Have a nice day.
Sincerely,Mandy
This comment was minimized by the moderator on the site
Thank you Mandy for illustrating it in detail.
Kindly guide how to get the last non zero value from same formula instead of first non zero value.
Will Match work for that or not?
This comment was minimized by the moderator on the site
Hi MandyZhou,

Thank you for the explanation!
I have a follow-up question.
How would the formula change if you had to look up the year too?
So in the above example, let's assume that column J is 'Year' and that in cell J2 is written '2015'.
And in cell K2 I would need the column header for the first non-zero value of the year in L2 (year 2015, so I would need to find 'Jun' in cell K2).

Thanks in advance for your help!
Jason
This comment was minimized by the moderator on the site
How can I return the second and third, etc non zero value? Your formula is amazing but I am trying to search more keywords from a text so sometimes they are 2 or 3 in the same sentence
This comment was minimized by the moderator on the site
se volessi "l'ultimo" Valore Diverso Da Zero E Restituire L'intestazione Della Colonna Corrispondente Con La Formula?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations