Note: The other languages of the website are Google-translated. Back to English
English English

Lookup and retrieve entire column

To lookup and retrieve an entire column by matching a specific value, an INDEX and MATCH formula will do you a favor.

lookup and retrieve entire column 1

Lookup and retrieve an entire column based on a specific value
Sum an entire column up based on a specific value
Further analysis of an entire column based on a specific value


Lookup and retrieve an entire column based on a specific value

To get a list of Q2 sales according to the table above, you can first use the MATCH function to return the position of the Q2 sales, and which will be fed to INDEX to retrieve the values at the position.

Generic syntax

=INDEX(return_range,0,MATCH(lookup_value,lookup_array,0))

√ Note: This is an array formula that requires you to enter with Ctrl + Shift + Enter.

  • return_range: The range where you want the combination formula to return the Q2 sales list from. Here refers to the sales range.
  • lookup_value: The value the combination formula used to find its corresponding sales information. Here refers to the given quarter.
  • lookup_array: The range of cells where to match the lookup_value. Here refers to the quarter headers.
  • match_type 0: Forces MATCH to find the first value that exactly equals to the lookup_value.

To get a list of Q2 sales, please copy or enter the formula below in the cell I6, press Ctrl + Shift + Enter, and then double click on the cell and press F9 to get the result:

=INDEX(C5:F11,0,MATCH("Q2",C4:F4,0))

Or, use a cell reference to make the formula dynamic:

=INDEX(C5:F11,0,MATCH(I5,C4:F4,0))

lookup and retrieve entire column 2

Explanation of the formula

=INDEX(C5:F11,0,MATCH(I5,C4:F4,0))

  • MATCH(I5,C4:F4,0): The match_type 0 forces the MATCH function to return the position of Q2, the value in I5, in the range C4:F4, which is 2.
  • INDEX(C5:F11,0,MATCH(I5,C4:F4,0)) = INDEX(C5:F11,0,2): The INDEX function returns all the values in the 2nd column of the range C5:F11 in an array like this: {7865;4322;8534;5463;3252;7683;3654}. Note that to make the array visible in Excel, you should double click on the cell where you entered the formula, and then press F9.

Sum an entire column up based on a specific value

Since we have the sales list in hand now, to get the Q2 total sales volume would be an easy case for us. All we need to do is to add the SUM function to the formula to sum all the sales values from the list.

Generic syntax

=SUM(INDEX(return_range,0,MATCH(lookup_value,lookup_array,0)))

In this very example, to get the Q2 total sales volume, please copy or enter the formula below in the cell I8, and press Enter to get the result:

=SUM(INDEX(C5:F11,0,MATCH(I5,C4:F4,0)))

lookup and retrieve entire column 3

Explanation of the formula

=SUM(INDEX(C5:F11,0,MATCH(I5,C4:F4,0)))

  • MATCH(I5,C4:F4,0): The match_type 0 forces the MATCH function to return the position of Q2, the value in I5, in the range C4:F4, which is 2.
  • INDEX(C5:F11,0,MATCH(I5,C4:F4,0)) = INDEX(C5:F11,0,2): The INDEX function returns all the values in the 2nd column of the range C5:F11 in an array like this: {7865;4322;8534;5463;3252;7683;3654}.
  • SUM(INDEX(C5:F11,0,MATCH(I5,C4:F4,0))) = SUM({7865;4322;8534;5463;3252;7683;3654}): The SUM function sums all the values in the array, and then gets the Q2 total sales volume, $40,773.

Further analysis of an entire column based on a specific value

For additional processing on the Q2 sales list, you can simply add other functions such as SUM, AVERAGE, MAX, MIN, LARGE, etc. to the formula.

For example, to get an average sales volume during Q2, you can use the formula:

=AVERAGE(INDEX(C5:F11,0,MATCH(I5,C4:F4,0)))

To find out the highest sales during Q2, use one of the below formulas:

=MAX(INDEX(C5:F11,0,MATCH(I5,C4:F4,0)))
OR
=LARGE(INDEX(C5:F11,0,MATCH(I5,C4:F4,0)),1)


Related functions

Excel INDEX function

The Excel INDEX function returns the displayed value based on a given position from a range or an array.

Excel MATCH function

The Excel MATCH function searches for a specific value in a range of cells, and returns the relative position of the value.


Related Formulas

Lookup and retrieve entire row

To lookup and retrieve an entire row of data by matching a specific value, you can use the INDEX and MATCH functions to create an array formula.

Exact match with INDEX and MATCH

If you need to find out the information listed in Excel about a specific product, movie or a person, etc., you should make a good use of the combination of INDEX and MATCH functions.

Approximate match with INDEX and MATCH

There are times when we need to find approximate matches in Excel to evaluate employees' performance, grade students’ scores, calculate postage based on weight, etc. In this tutorial, we will talk about how to use the INDEX and MATCH functions to retrieve the results we need.

Case-sensitive lookup

You may know that you can combine the INDEX and MATCH functions, or use the VLOOKUP function to lookup values in Excel. However, the lookups aren’t case-sensitive. So, in order to perform a case-sensitive match, you should take advantage of the EXACT and CHOOSE functions.


The Best Office Productivity Tools

Kutools for Excel - Helps You To Stand Out From Crowd

Would you like to complete your daily work quickly and perfectly? Kutools for Excel brings 300 powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) and save 80% time for you.

  • Designed for 1500 work scenarios, helps you solve 80% Excel problems.
  • Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands.
  • Become an Excel expert in 3 minutes. No longer need to remember any painful formulas and VBA codes.
  • 30-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years.
Ribbon of Excel (with Kutools for Excel installed)

Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Firefox, And New Internet Explorer.
Screen Shot of Excel (with Office Tab installed)
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations