メインコンテンツへスキップ

Excelで最初、2番目、またはn番目の一致値をvlookupで見つける方法は?

以下のスクリーンショットに示すように、製品と数量を含むXNUMXつの列があるとします。 XNUMX本目またはXNUMX本目のバナナの量をすばやく見つけるために、あなたはどうしますか?

ここで、vlookup関数はこの問題に対処するのに役立ちます。 この記事では、ExcelのVlookup関数を使用して、vlookupがXNUMX番目、XNUMX番目、またはn番目の一致値を見つける方法を示します。

Vlookupは、数式を使用してExcelで最初、2番目、またはn番目の一致値を検索します

簡単にvlookupは、Kutools forExcelを使用してExcelで最初の一致値を見つけます


Vlookupは、Excelで最初、2番目、またはn番目の一致値を検索します

Excelで2番目、XNUMX番目、またはn番目の一致値を見つけるには、次の手順を実行してください。

1.セルD1に、vlookupする基準を入力します。ここでは、バナナを入力します。

2.ここで、バナナの最初の一致値を見つけます。 E2などの空白のセルを選択し、数式をコピーして貼り付けます =INDEX($B$2:$B$6,MATCH(TRUE,EXACT($D$1,$A$2:$A$6),0)) 数式バーに入力し、を押します Ctrlキー + シフト + 入力します キーを同時に押す。

Note:この式では、$ B $ 2:$ B $ 6は一致する値の範囲です。 $ A $ 2:$ A $ 6は、vlookupのすべての基準を含む範囲です。 $ D $ 1は、指定されたvlookup基準を含むセルです。

次に、セルE2でバナナの最初の一致値を取得します。 この式では、基準に基づいて最初に対応する値のみを取得できます。

n番目の相対値を取得するには、次の式を適用できます。 =INDEX($B$2:$B$6,SMALL(IF($D$1=$A$2:$A$6,ROW($A$2:$A$6)-ROW($A$2)+1),1)) + Ctrlキー + シフト + 入力します キーを一緒に使用すると、この数式は最初に一致した値を返します。

ノート:

1. XNUMX番目の一致値を見つけるには、上記の式を次のように変更してください。 =INDEX($B$2:$B$6,SMALL(IF($D$1=$A$2:$A$6,ROW($A$2:$A$6)-ROW($A$2)+1),2))、を押してから Ctrlキー + シフト + 入力します 同時にキー。 スクリーンショットを参照してください:

2.上記の式の最後の数値は、vlookup基準のn番目の一致値を意味します。 3に変更すると、XNUMX番目の一致値が取得され、nに変更すると、n番目の一致値が検出されます。


Vlookupは、Kutools forExcelを使用してExcelで最初の一致値を検索します

Y数式を覚えていなくても、Excelで最初の一致値を簡単に見つけることができます。 リストで値を探す 式の式 Kutools for Excel.

申請する前に Kutools for Excelについては 最初にダウンロードしてインストールします.

1.最初に一致する値を見つけるためのセル(セルE2など)を選択し、[ クツール > フォーミュラヘルパー > フォーミュラヘルパー。 スクリーンショットを参照してください:

3。 の中に フォーミュラヘルパー ダイアログボックスで、次のように構成してください。

  • 3.1で 式を選択してください ボックスで、検索して選択します リストで値を探す;
    ヒント:確認できます フィルタ ボックスで、テキストボックスに特定の単語を入力して、数式をすばやくフィルタリングします。
  • 3.2で テーブル・アレイ ボックスで、 最初に一致する値の値を含むテーブル。;
  • 3.2で 参照値 ボックスで、セルに含まれているセルを選択します 基準 に基づいて最初の値を返します。
  • 3.3で コラム ボックスで、一致した値を返す列を指定します。 または、必要に応じて列番号をテキストボックスに直接入力することもできます。
  • 3.4 OK ボタン。 スクリーンショットを参照してください:

これで、ドロップダウンリストの選択に基づいて、対応するセル値がセルC10に自動入力されます。

  このユーティリティの無料トライアル(30日)が必要な場合は、 クリックしてダウンロードしてください、次に、上記の手順に従って操作を適用します。

最高のオフィス生産性向上ツール

🤖 Kutools AI アシスタント: 以下に基づいてデータ分析に革命をもたらします。 インテリジェントな実行   |  コードを生成  |  カスタム数式の作成  |  データを分析してグラフを生成する  |  Kutools関数を呼び出す...
人気の機能: 重複を検索、強調表示、または識別する   |  空白行を削除する   |  データを失わずに列またはセルを結合する   |   数式なしのラウンド ...
スーパールックアップ: 複数の基準の VLookup    複数の値の VLookup  |   複数のシートにわたる VLookup   |   ファジールックアップ ....
詳細ドロップダウン リスト: ドロップダウンリストを素早く作成する   |  依存関係のドロップダウン リスト   |  複数選択のドロップダウンリスト ....
列マネージャー: 特定の数の列を追加する  |  列の移動  |  Toggle 非表示列の表示ステータス  |  範囲と列の比較 ...
注目の機能: グリッドフォーカス   |  デザインビュー   |   ビッグフォーミュラバー    ワークブックとシートマネージャー   |  リソースライブラリ (自動テキスト)   |  日付ピッカー   |  ワークシートを組み合わせる   |  セルの暗号化/復号化    リストごとにメールを送信する   |  スーパーフィルター   |   特殊フィルター (太字/斜体/取り消し線をフィルター...) ...
上位 15 のツールセット12 テキスト ツール (テキストを追加, 文字を削除する、...)   |   50+ チャート 種類 (ガントチャート、...)   |   40+ 実用的 (誕生日に基づいて年齢を計算する、...)   |   19 挿入 ツール (QRコードを挿入, パスから画像を挿入、...)   |   12 変換 ツール (数字から言葉へ, 通貨の換算、...)   |   7 マージ&スプリット ツール (高度な結合行, 分割セル、...)   |   ... もっと

Kutools for Excel で Excel スキルを強化し、これまでにない効率を体験してください。 Kutools for Excelは、生産性を向上させ、時間を節約するための300以上の高度な機能を提供します。  最も必要な機能を入手するにはここをクリックしてください...

説明


Officeタブは、タブ付きのインターフェイスをOfficeにもたらし、作​​業をはるかに簡単にします

  • Word、Excel、PowerPointでタブ付きの編集と読み取りを有効にする、パブリッシャー、アクセス、Visioおよびプロジェクト。
  • 新しいウィンドウではなく、同じウィンドウの新しいタブで複数のドキュメントを開いて作成します。
  • 生産性を 50% 向上させ、毎日何百回もマウス クリックを減らすことができます!
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