Ugrás a tartalomra

Hogyan keresse meg az első nem nulla értéket, és adja vissza a megfelelő oszlopfejlécet az Excelben?

Ha feltételezzük, hogy van egy adattartománya, akkor vissza akarja adni az oszlopfejlécet abban a sorban, ahol az első nem nulla érték fordul elő, a jelen képernyőképen látható módon, ez a cikk bemutat egy hasznos képletet a feladat kezeléséhez. az Excelben.

doc keresés első nem nulla 1

Keresse meg az első nem nulla értéket, és adja vissza a megfelelő oszlopfejlécet képlettel


nyíl kék jobb buborék Keresse meg az első nem nulla értéket, és adja vissza a megfelelő oszlopfejlécet képlettel

A következő első nulla érték nélküli oszlopfejléc visszaadásához a következő képlet segíthet, kérjük, tegye a következőket:

Írja be ezt a képletet: =INDEX($B$1:$I$1,MATCH(TRUE,INDEX(B2:I2<>0,),0)) egy üres cellába, ahol meg akarja találni az eredményt, K2például, majd húzza lefelé a kitöltő fogantyút azokra a cellákra, amelyeken alkalmazni szeretné ezt a képletet, és az első, nulla érték nélküli megfelelő oszlopfejlécek a következő képernyőképen kerülnek visszaadásra:

doc keresés első nem nulla 2

Megjegyzések: A fenti képletben B1: I1 a visszaadni kívánt oszlopfejlécek, B2: I2 az a soradat, amelyet meg akar keresni az első nem nulla érték.

A legjobb irodai hatékonyságnövelő eszközök

🤖 Kutools AI Aide: Forradalmasítsa az adatelemzést a következők alapján: Intelligens végrehajtás   |  Kód létrehozása  |  Hozzon létre egyéni képleteket  |  Adatok elemzése és diagramok létrehozása  |  A Kutools funkciók meghívása...
Népszerű szolgáltatások: Ismétlődések keresése, kiemelése vagy azonosítása   |  Üres sorok törlése   |  Oszlopok vagy cellák kombinálása adatvesztés nélkül   |   Kerek Formula nélkül ...
Szuper keresés: Több kritérium VLookup    Többértékű VLookup  |   VLookup több munkalapon   |   Fuzzy Lookup ....
Speciális legördülő lista: Gyors legördülő lista létrehozása   |  Függő legördülő lista   |  Többszörösen válassza ki a legördülő listát ....
Oszlopkezelő: Adjon meg egy adott számú oszlopot  |  Oszlopok mozgatása  |  Kapcsolja be a Rejtett oszlopok láthatósági állapotát  |  Tartományok és oszlopok összehasonlítása ...
Kiemelt funkciók: Rács fókusz   |  Design nézet   |   Nagy Formula bár    Munkafüzet és lapkezelő   |  Erőforrás-könyvtár (Auto szöveg)   |  Dátumválasztó   |  Kombinálja a munkalapokat   |  Cellák titkosítása/dekódolása    E-mailek küldése listánként   |  Szuper szűrő   |   Speciális szűrő (félkövér/dőlt/áthúzott szűrés...) ...
A 15 legjobb eszközkészlet12 szöveg Eszközök (Szöveg hozzáadása, Karakterek eltávolítása,...)   |   50 + Táblázatos Típusai (Gantt-diagram,...)   |   40+ Praktikus képletek (Számolja ki az életkort a születésnap alapján,...)   |   19 beszúrás Eszközök (Helyezze be a QR-kódot, Kép beszúrása az útvonalból,...)   |   12 Átalakítás Eszközök (Számok szavakig, Valuta átváltás,...)   |   7 Egyesítés és felosztás Eszközök (Haladó kombinált sorok, Hasított sejtek,...)   |   ... és több

Töltsd fel Excel-készségeidet a Kutools for Excel segítségével, és tapasztald meg a még soha nem látott hatékonyságot. A Kutools for Excel több mint 300 speciális funkciót kínál a termelékenység fokozásához és az időmegtakarításhoz.  Kattintson ide, hogy megszerezze a leginkább szükséges funkciót...

Leírás


Az Office lap füles felületet hoz az Office-ba, és sokkal könnyebbé teszi a munkáját

  • Füles szerkesztés és olvasás engedélyezése Wordben, Excelben és PowerPointban, Publisher, Access, Visio és Project.
  • Több dokumentum megnyitása és létrehozása ugyanazon ablak új lapjain, mint új ablakokban.
  • 50% -kal növeli a termelékenységet, és naponta több száz kattintással csökkenti az egér kattintását!
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