Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88854

Referencing dynamic external tables from names stored in a cell VLOOKUP

$
0
0

I have several workbooks containing a series of different ID's that I want to validate by comparing them to their source IDs. These source ID's are also stored across several workbooks, each contains several worksheets and columns with ID's in them. So Workbook1 will contain say 5 Sheets each has 5 Source ID's.

I have 1 column which contains the filepath of the Source ID. For example, for ID_that_needs_checking_1, the relevant Source ID filepath is stored in cell C2: [Workbook1]Sheet1!A1:Z100 (I've selected a broad range and then will offset the table to the correct column number. I'm not sure if there's a better way to just select the column directly since I do have column number, but I wasn't sure how to do this since the column uses alphabets). =Address() didn't work. I'd be curious to know if there's a better way of doing this!)

For each row of ID_that_needs_checking_1 I want to do conditional formatting so it highlights green for the matching rows and red for ones where no match is found. To do this, I want to apply a ISNA(VLOOKUP) Formula that does this:

=VLOOKUP(Id_that_needs_checking,OFFSET(C2,0,L2-1),1,FALSE) where C2: [Workbook]Sheet1!A1:Z100 that contains the Source ID. (I need to offset because I'm just looking to see if the value is a match or not. L2 is the column number of the Source ID)

I want to use C2 is so that the filepath name is dynamic depending on which ID needs checking. I have tried using the "&C2&" but that doesn't seem to work for these purposes, and simply referencing the cell C2 doesn't work. It works fine if I type in the full filepath into the VLOOKUP, i.e. =VLOOKUP(Id_that_needs_checking,OFFSET([Workbook]Sheet1!A1:Z100,0,l2-1),1,FALSE) works but would take a long time to type for each cell.

Is there any way to do this in Excel? Or is there perhaps an entirely different method to do this that I'm missing? (If necessary, I can use VBA to insert the correct formulas)

Thanks in advance!


Viewing all articles
Browse latest Browse all 88854

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>