Using Excel to get data from another sheet based on cell value

Getting data from another spreadsheet based on a cell value might be quite useful for some projects and reports. In this short article, I will show using Excel how you can get data from another worksheet based on a cell value. I will pull data using two ways: Using Index and Match function combo and using VLOOKUP/HLOOKUP Excel function.

Getting Data from another worksheet (using INDEX & MATCH)

You’re seeing a worksheet (‘Sheet1’) below with some dummy data.

In the following image, you are seeing my ‘Get’ worksheet data. In the B2 cell, you see I have input value 3/2018. All the values from the ‘Sheet1’ worksheet and under the 3/2018 column are showing under the ‘Data’ heading.

This is the formula that I have used in the cell D4 and then dragged down the formula for 10 cells. You’re also seeing the formulas of cells D5 and D6 cells on the right side of the cells.

=INDEX(Sheet1!$A2:$E2,MATCH($B$3,Sheet1!$A$1:$E$1,0))

Excel get data from another sheet based on cell value

MATCH Function overview

To understand this formula, you have to understand MATCH and INDEX functions at first.

Match function returns the relative position of an item in an array that matches a specified value in a specified order.

Syntax of Match function: MATCH (lookup_value, lookup_array, [match_type])

Check out the following worksheet. You will get the idea how Match function works.

Index Function Overview

Index function returns the intersection value of two rows and columns in an array.

Syntax of Index function:

Array Form: INDEX (array, row_num, [column_num])

Reference Form: INDEX (reference, row_num, [column_num], [area_num])

Check out the following image. The gest of Index function is showed in this image.

Breakdown of the formula

Let’s now explain how this formula is working.

=INDEX(Sheet1!$A2:$E2,MATCH($B$3,Sheet1!$A$1:$E$1,0))

This part of this formula, MATCH($B$3,Sheet1!$A$1:$E$1,0), will find an exact match in this array ($A$1:$E$1) for the value in $B$3.

Match function finds this value at position 3. So, the formula, MATCH($B$3,Sheet1!$A$1:$E$1,0), will return value 3.

So, our new formula is: =INDEX(Sheet1!$A2:$E2, 3)

The interpretation of this part is very simple. Think $A$2:$E$2 as an array and its 3rd value is 75 (as there is no column to do the intersection) as you’re seeing in the image below.

Getting data from another sheet using HLOOKUP Function

Let’s see how we can solve this problem using HLOOKUP excel function. At first, take a look at the following image to find how HLOOKUP function works in Excel.

To use this method, we will need a helping column that you’re seeing in the following image.

I have used this formula in cell D4 and then dragged down this formula in the cells below:

=HLOOKUP($B$3,Sheet1!$A$1:$E$11,C4+1,0)

If you understand the HLOOKUP function appropriately, then this formula is easy to understand. For your easy understanding, I have added a glimpse of ‘Sheet1’ worksheet (bottom right corner) in the same worksheet where I am applying the formula.

Download Working File

Conclusion

This is a short article but there are so many things to learn from this article.

So, this is the way I can get data from another sheet based on cell value using MS Excel. Do you know any other technique? Let me know in the comment box. I am eager to learn a new technique on this topic.


Hello! Welcome to my Excel blog! It took me some time to be a fan of Excel. But now I am a die-hard fan of MS Excel. I learn new ways of doing things with Excel and share here. Not only how to guide on Excel, but you will get also topics on Finance, Statistics, Data Analysis, and BI. Stay tuned!

6 Comments
  1. Reply
    James Gatliff May 28, 2018 at 9:14 PM

    A very powerful message and useful presentation. Thank you for presenting this.

    • Reply
      Kawser May 29, 2018 at 11:27 AM

      James, thanks for your feedback.
      Glad to hear that it was useful for you.
      Regards

  2. Reply
    Surya February 25, 2019 at 7:50 AM

    Thank you for this useful article, nicely explained.

  3. Reply
    Ferreira February 26, 2019 at 8:25 PM

    Very simple, good

    • Reply
      Kawser February 27, 2019 at 6:34 PM

      Thanks, FERREIRA for your feedback!

    Leave a reply