View Single Post
 
Old 04-06-2012, 07:08 PM
caholmes caholmes is offline Windows Vista Office 2007
Advanced Beginner
 
Join Date: Dec 2008
Location: Sydney, Australia
Posts: 54
caholmes is on a distinguished road
Default

Hi Rich,

you can nest a match function inside a vlookup to work out the column number for you.

So a simple vlookup would look like this:
=VLOOKUP(A2,'Company Accidents'!A1:H6,2,0)

with a nested match function:
=VLOOKUP(A2,'Company Accidents'!A1:H6,MATCH(B$1,'Company Accidents'!$A$1:$H$1,0),0)

and finally to fix any errors if not found, add an iferror function:
=IFERROR(VLOOKUP(A2,'Company Accidents'!A1:H6,MATCH(B$1,'Company Accidents'!$A$1:$H$1,0),0),"")

Please see attached solution
Attached Files
File Type: xlsx Vlookup with Nested Match.xlsx (10.5 KB, 26 views)
Reply With Quote