Hoppa till huvudinnehåll

Hur kan jag hitta det första, andra eller nte matchningsvärdet i Excel?

Om du antar att du har två kolumner med produkter och kvantiteter enligt nedanstående skärmdump. För att snabbt ta reda på mängderna av den första eller andra bananen, vad skulle du göra?

Här kan vlookup-funktionen hjälpa dig att hantera detta problem. I den här artikeln kommer vi att visa dig hur du kan hitta det första, andra eller det nte matchningsvärdet med Vlookup-funktionen i Excel.

Vlookup hittar det första, andra eller nte matchningsvärdet i Excel med formel

Enkelt att hitta det första matchningsvärdet i Excel med Kutools för Excel


Vlookup hittar det första, andra eller nionde matchningsvärdet i Excel

Gör så här för att hitta det första, andra eller nionde matchningsvärdet i Excel.

1. I cell D1, ange kriterierna som du vill titta på, här anger jag Banana.

2. Här hittar vi banans första matchvärde. Välj en tom cell som E2, kopiera och klistra in formel =INDEX($B$2:$B$6,MATCH(TRUE,EXACT($D$1,$A$2:$A$6),0)) in i formelfältet och tryck sedan på ctrl + shift + ange tangenter samtidigt.

Anmärkningar: I denna formel är $ B $ 2: $ B $ 6 intervallet för matchande värden; $ A $ 2: $ A $ 6 är intervallet med alla kriterier för vlookup; $ D $ 1 är cellen som innehåller de angivna vlookup-kriterierna.

Då får du det första matchningsvärdet för banan i cell E2. Med den här formeln kan du bara få det första motsvarande värdet baserat på dina kriterier.

För att få nionde relativa värden kan du använda följande formel: =INDEX($B$2:$B$6,SMALL(IF($D$1=$A$2:$A$6,ROW($A$2:$A$6)-ROW($A$2)+1),1)) + ctrl + shift + ange tangenter tillsammans, denna formel returnerar det första matchade värdet.

Anmärkningar:

1. För att hitta det andra matchningsvärdet, ändra ovanstående formel till =INDEX($B$2:$B$6,SMALL(IF($D$1=$A$2:$A$6,ROW($A$2:$A$6)-ROW($A$2)+1),2)), och tryck sedan på ctrl + shift + ange samtidigt. Se skärmdump:

2. Det sista numret i ovanstående formel betyder det nte matchningsvärdet för vlookup-kriterierna. Om du ändrar det till 3 får det det tredje matchningsvärdet och ändras till n kommer det nte matchningsvärdet att visas.


Vlookup hittar det första matchningsvärdet i Excel med Kutools för Excel

YDu kan enkelt hitta det första matchningsvärdet i Excel utan att komma ihåg formler med Leta efter ett värde i listan formel formel av Kutools för Excel.

Innan du ansöker Kutools för ExcelBer ladda ner och installera det först.

1. Välj en cell för att hitta det första matchande värdet (säger cell E2) och klicka sedan på Kutools > Formel Helper > Formel Helper. Se skärmdump:

3. I Formel Helper dialogrutan, konfigurera följande:

  • 3.1 I Välj en formel rutan, hitta och välj Leta efter ett värde i listan;
    tips: Du kan kontrollera Filter rutan, ange ett visst ord i textrutan för att snabbt filtrera formeln.
  • 3.2 I Tabell_array markera rutan tabell som innehåller de första matchande värdena.;
  • 3.2 I Uppslagningsvärde välj cellen som innehåller kriterier du returnerar det första värdet baserat på;
  • 3.3 I Kolumn rutan, ange kolumnen som du returnerar det matchade värdet från. Eller så kan du ange kolumnnumret i textrutan direkt efter behov.
  • 3.4 Klicka på OK knapp. Se skärmdump:

Nu motsvarar motsvarande cellvärde automatiskt i cell C10 baserat på val av rullgardinsmeny.

  Om du vill ha en gratis provperiod (30 dagar) av det här verktyget, klicka för att ladda ner den, och gå sedan till för att tillämpa operationen enligt ovanstående steg.

Bästa kontorsproduktivitetsverktyg

🤖 Kutools AI Aide: Revolutionera dataanalys baserat på: Intelligent utförande   |  Generera kod  |  Skapa anpassade formler  |  Analysera data och generera diagram  |  Anropa Kutools funktioner.
Populära funktioner: Hitta, markera eller identifiera dubbletter   |  Ta bort tomma rader   |  Kombinera kolumner eller celler utan att förlora data   |   Rund utan formel ...
Superuppslag: Flera kriterier VLookup    VLookup med flera värden  |   VSök över flera ark   |   Fuzzy Lookup ....
Avancerad rullgardinslista: Skapa snabbt en rullgardinslista   |  Beroende rullgardinslista   |  Flervals-rullgardinslista ....
Kolumnhanterare: Lägg till ett specifikt antal kolumner  |  Flytta kolumner  |  Växla synlighetsstatus för dolda kolumner  |  Jämför intervall och kolumner ...
Utvalda funktioner: Rutnätsfokus   |  Designvy   |   Stor formelbar    Arbetsbok & Bladhanterare   |  Resursbibliotek (Automatisk text)   |  Datumväljare   |  Kombinera arbetsblad   |  Kryptera/Dekryptera celler    Skicka e-postmeddelanden efter lista   |  Superfilter   |   Specialfilter (filtrera fet/kursiv/genomstruken...) ...
Topp 15 verktygssatser12 text verktyg (lägga till text, Ta bort tecken, ...)   |   50+ Diagram Typer (Gantt Chart, ...)   |   40+ Praktiskt Formler (Beräkna ålder baserat på födelsedag, ...)   |   19 Införande verktyg (Infoga QR-kod, Infoga bild från sökväg, ...)   |   12 Konvertering verktyg (Siffror till ord, Valutaväxling, ...)   |   7 Slå ihop och dela verktyg (Avancerade kombinera rader, Dela celler, ...)   |   ... och mer

Uppgradera dina Excel-färdigheter med Kutools för Excel och upplev effektivitet som aldrig förr. Kutools för Excel erbjuder över 300 avancerade funktioner för att öka produktiviteten och spara tid.  Klicka här för att få den funktion du behöver mest...

Beskrivning


Fliken Office ger ett flikgränssnitt till Office och gör ditt arbete mycket enklare

  • Aktivera flikredigering och läsning i Word, Excel, PowerPoint, Publisher, Access, Visio och Project.
  • Öppna och skapa flera dokument i nya flikar i samma fönster, snarare än i nya fönster.
  • Ökar din produktivitet med 50 % och minskar hundratals musklick för dig varje dag!
Comments (43)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
You only return first match with VLOOKUP so your article "How To Vlookup Find The First, 2nd Or Nth Match Value In Excel?" does not make any sense....
This comment was minimized by the moderator on the site
Hi Sima,
"VLOOKUP" is a Google search term, so I used it as a keyword for the article title. The main operation of this article is to lookup values. I'm sorry for the misunderstanding.
This comment was minimized by the moderator on the site
What if the next record on col b is a duplicate how do ignore duplicate? Let's Banana has quantities of 200 twice? Can you please help me figure out how to ignore the duplicate?
This comment was minimized by the moderator on the site
Cna anybody Explain the small function with the IF statement for me please? I don't really understand how that array works :(
This comment was minimized by the moderator on the site
The following formulas works perfect for me:
(a) or(b) =IF(H8='Raw Data'!B4,INDEX('Raw Data'!H6:H20,SMALL(IF(C18='Raw Data'!B6:B20,ROW('Raw Data'!B6:B20)-ROW('Raw Data'!B6:B20)+1),1)))

However, I have encountered a problem where there are 7 sets of the same criteria but in different columns:(1) can the above formula (a) be repeated and search in a different cells in a single formula and(2) the above formula (b) only allows up to two sets of the similar search with matched value result but when trying for the third set in the formula as showed below, Microsoft Excel appeared as "You've entered too many arguments for this function."
=<span style="letter-spacing: 0.2px; color: inherit; font-family: inherit; font-style: inherit; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit;">IF(H8='Raw Data'!J4,INDEX('Raw Data'!P6:P20,SMALL(IF(C18='Raw Data'!J6:J20,ROW('Raw Data'!J6:J20)-ROW('Raw Data'!J6:J20)+1),1))),</span>
This comment was minimized by the moderator on the site
What do Ctrl + Shift + Enter do?? At the beginning I didn'
This comment was minimized by the moderator on the site
Hi,An array formula needs to hit the Ctrl + Shift + Enter keys simultaneously to get the correct result.
This comment was minimized by the moderator on the site
I have a scenario... How do I get last price of anything for reference... Example: Banana first price was 200... While purchasing for second time; I need to display 200 in my expected price cell and then if I buy that on the day at 220, I will put this value manually as 220... Whenever next time I will buy banana; I need to display 220 from the last purchase price
This comment was minimized by the moderator on the site
Try =INDEX($B$2:$B$6,XMATCH(TRUE,EXACT($D$1,$A$2:$A$6),0,-1))

This is essentially reversing the search order and returning the first match using the XMATCH function.

Better late than never, hopefully helps someone :)
This comment was minimized by the moderator on the site
Perfect explanation, thanks.
This comment was minimized by the moderator on the site
If the first or any of the other entry's for 'banana' column B was blank cell, of which I don't require this number, what changes are required to this formula to skip blank cell in column B.
This comment was minimized by the moderator on the site
Sorry I am using this formula
=INDEX($B$2:$B$6,SMALL(IF($D$1=$A$2:$A$6,ROW($A$2:$A$6)-ROW($A$2)+1),1))
This comment was minimized by the moderator on the site
SOLVED:
=SMALL(IF(A2:A7=D1,IF(B2:B7<>"",B2:B7)),1)

If 2nd or 3rd number required exchange ),1) to 2 or 3

This formula does not require index, as it directly looks at the value in Cell
This comment was minimized by the moderator on the site
Correction to previous formula:
The value was reading either the lesser or greater.

Updated formula
=INDEX($B$2:$B$7,SMALL(IF($A2:$A6=$D$1,IF($B$2:$B$7<>"",ROW($A2:$A6)-ROW($A2)+1)),1))

This skips blank cell and places value of non blank cell. Replace +1 with +2 or +3 for 2nd or 3rd value
This comment was minimized by the moderator on the site
And if you want the last, second last, nth last just add a counter (count the number of events already hapenned) to the end and subtract it by 0,1,n respectively.

Thank you so much! I was searching for this for a long time
This comment was minimized by the moderator on the site
Good Day,
Sorry can't help you with this yet. Thank you for your comment.
This comment was minimized by the moderator on the site
Is it possible to find an average of the non-unique data. Or would it be possible to have a list dropdown on the cell of the various values?
This comment was minimized by the moderator on the site
Good Day,
Sorry can't help you with this yet. Thank you for your comment.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations