Solved

# LOOKUP, INDEX, MATCH, MAX?

Posted on 2013-05-16
285 Views
I have been tasked with seeing if I can pull column header info into a report. The report uses a series of lookups to pull information from two different sources.   The lookup value is in column B,  table array is B:O. My challenges is that I need to look at columns j-o by row and find the column with the last value and return the column header value, is this possible?
Sample-Level.xlsx
0
Question by:jmac001
• 6
• 6

LVL 23

Expert Comment

Try:

=IFERROR(INDEX(\$C\$2:\$H\$2,MATCH(10^10,\$C3:\$H3)),0)

copied down.

0

Author Comment

I apologize for not being clear the information is located in a different workbook. Is it still possible to do with Index/Match?
0

LVL 23

Expert Comment

e.g

=IFERROR(INDEX('[Sample-Level.xlsx]Sheet1'!\$C\$2:\$H\$2,MATCH(10^10,'[Sample-Level.xlsx]Sheet1'!\$C3:\$H3)),0)
0

Author Comment

Can you please explain what 10^10 does.  Thanks
0

LVL 23

Expert Comment

It's a very large number. Match() without the third argument looks for the largest match that is smaller than the, LOOKUP value which you should 10^10.  so the last number that is smaller in each row is the last number in the row always.
0

Author Comment

Thanks, question how does it match back and return the data to the appropriate cell if a lookup is not being used.  The forumla is working but the data is not aligned to the correct project?
0

LVL 23

Expert Comment

So you are saying you want to match up the store too, which may not be in same order?

If so,

=IFERROR(INDEX('[Sample-Level.xlsx]Sheet1'!\$C\$1:\$H\$1,MATCH(10^10,INDEX('[Sample-Level.xlsx]Sheet1'!\$C\$2:\$H\$10,MATCH(A2,'[Sample-Level.xlsx]Sheet1'!\$A\$2:\$A\$10,0),0))),"")

where it is assumed the table is in '[Sample-Level.xlsx]Sheet1'!\$C\$1:\$H\$10 and the Store you want to look up is in A2 of your active (formula) sheet.
0

Author Comment

Updated know I am getting all zeros.
0

LVL 23

Expert Comment

See attached.

I put the formula in Sheet2., but you can CUT (not Copy) and Paste in another workbook, and it should update, you may need to just change the A2 in the formula to coincide to where the Store you want to lookup is in that workbook.

Also you will need to adjust the ranges if they are really larger than to row 9;
Copy-of-Sample-Level-1.xlsx
0

Author Comment

I am getting mixed results, some rows are pulling the correct level and others are not.
Test-Cost-Variance.xlsx
Test-Forecast.xls
0

LVL 23

Accepted Solution

NBVC earned 500 total points
Your ranges didn't start and end at same row number.

Try:

=IFERROR(INDEX('[Test-Forecast.xls]Forecast Summary'!\$J\$1:\$O\$1,MATCH(10^10,INDEX('[Test-Forecast.xls]Forecast Summary'!\$J\$3:\$O\$175,MATCH(B3,'[Test-Forecast.xls]Forecast Summary'!\$B\$3:\$B\$175,0),0))),"")
0

Author Closing Comment

Thank you so much I did adjust, but only to 2 didn't go far enough/
0

## Featured Post

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…