Solved

Match Index Formula?

Posted on 2012-03-14
5
186 Views
Last Modified: 2012-08-14
I have a table which I download from Access on a regular basis in which the columns may change.

I want to assign the "P" values underneath the correct column in a static table in Excel.

Please see attched example
Book1.xls
0
Comment
Question by:fitaliano
  • 3
5 Comments
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 37720924
You can enter this formula in B10 and copy down and across

=IFERROR(IF(INDEX($B$3:$F$5,MATCH($A18,$A$3:$A$5,0),MATCH(B$17,$B$2:$F$2,0))="","",INDEX($B$3:$F$5,MATCH($A18,$A$3:$A$5,0),MATCH(B$17,$B$2:$F$2,0))),"")
0
 
LVL 41

Expert Comment

by:dlmille
ID: 37721101
If your data is numeric, then we can use this:

[B10]=SUMPRODUCT(($B$3:$F$5)*($B$2:$F$2=B$9)*($A$3:$A$5=$A14))
Copy down and across

However, this will result in Zero at intersections that don't exist.  of course, you could put an IF statement around it to turn it to blank if not found.

=IF(equation=0,"",equation)

See attached.

Dave
Book1.xls
0
 
LVL 41

Expert Comment

by:dlmille
ID: 37721138
If the data is not numeric, then the INDEX/MATCH approach works fine:

[B10]=IF(ISERROR(INDEX($B$3:$F$5,MATCH($A10,$A$3:$A$5,0),MATCH(B$9,$B$2:$F$2,0))),"",INDEX($B$3:$F$5,MATCH($A10,$A$3:$A$5,0),MATCH(B$9,$B$2:$F$2,0)))

And if you want blanks to appear as blank on the MATCH condition (e.g., if no P is there, you want blank, not zero), then use this:
[b10]=IF(OR(ISERROR(MATCH($A10,$A$3:$A$5,0)),ISERROR(MATCH(B$9,$B$2:$F$2,0))),"",IF(INDEX($B$3:$F$5,MATCH($A10,$A$3:$A$5,0),MATCH(B$9,$B$2:$F$2,0))=0,"",INDEX($B$3:$F$5,MATCH($A10,$A$3:$A$5,0),MATCH(B$9,$B$2:$F$2,0))))

Copy down and across.

See attached.

Dave
Book1.xls
0
 

Author Comment

by:fitaliano
ID: 37721140
It is not working for me, can you put it in the Excel file?
0
 
LVL 41

Accepted Solution

by:
dlmille earned 500 total points
ID: 37721158
@fitaliano - I posted my examples in attached workbooks.  Start with my last post, which works with non-numeric and blank if blank is found.

Dave
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
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…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now