Getting the 2nd matching value from a list using VLOOKUP formula

Share

Facebook
Twitter
LinkedIn
This article is part of our VLOOKUP Week. Read more.

Situation

We know that VLOOKUP formula is useful to fetch the first matching item from a list. So what would you do if you need 2nd (or 3rd etc.) matching item from a list?

For eg. If you have below data, and you want to find out how much sales John made 2nd time, then VLOOKUP formula becomes quite useless. Or is it?!?

Data:

Data for this Example -Getting the 2nd matching item from a list using VLOOKUP formula

Solution

A simple solution to this problem would be sorting our data on sales person’s name. That way all Johns would line up one beneath another. And we just have to find the first John’s position and add 1 to it to get to 2nd occurrence. Like this =MATCH("John", C5:C17, 0) + 1

But sorting is not an option all the time. So there should be a better way to do this?

Well, there is. We just add a helper column before the sales person name and fill it with sales-person’s name & occurrence. (see the below data table).

For this we can use COUNTIF() Formula, like this: =C5&COUNTIF($C$5:C5,C5). Notice the $C$5:C5?, well the mix of absolute & relative references does the trick here and gets John1, John2… etc.

Now, to lookup 2nd occurance of John, all we do is, simply write =VLOOKUP("John2",...) and we are done.

Data for this Example -Getting the 2nd matching item from a list using VLOOKUP formula

Sample File

Download Example File – Getting the 2nd matching item from a list using VLOOKUP formula

The file includes few examples on how to fetch 2nd, 3rd etc. matches using lookup formulas. It also has some interesting (and challenging) home work for you. Download & play with it.

Similar Tips

VLOOKUP Week @ Chandoo.org - Learn tips on lookup formulas in Excel

Facebook
Twitter
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Overall I learned a lot and I thought you did a great job of explaining how to do things. This will definitely elevate my reporting in the future.
Rebekah S
Reporting Analyst
Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

8 Responses to “Create a Combination Chart, Add Secondary Axis in Excel [15 Second Tutorial]”

  1. [...] Select the “daily completed” column and add it to the burn down chart. Once added, change the chart type for this series to bar chart (read how you can combine 2 different chart types in one) [...]

  2. [...] set the height series to be plotted on secondary axis. Learn more about combining 2 chart types and adding secondary axis in [...]

  3. [...] To show the years, I have used another dummy series and plotted it on secondary axis (related: how to add secondary axis?) [...]

  4. Thanks for this one!

  5. [...] Choisissez la colonne « Daily Completed » et ajoutez-la au graphique. Une fois ajoutée, changez le type de graphique pour cette série à histogramme (lisez comment combiner 2 types de graphiques en un : combine 2 different chart types in one) [...]

  6. Nat says:

    How do i create a chart that has negative numbers on axis x and y and plot them correctly? I cannot seem to understand how to do this, please help.
    Thanks.

    Nat

  7. MSWebReviewer says:

    You can also plot 2 or more Y axes in Excel using EZplot or Multy_Y from Office Expander.com
    There is a demo version to try.
    Cheers.

Leave a Reply