Vlookup indirect

Alex O

Active Member
Joined
Mar 16, 2009
Messages
345
Office Version
  1. 365
Platform
  1. Windows
I'm trying to get my formula in Y3 to search another sheet (Week1) and within the range u2:v14500 find the value in x3 and return the value 1 column over. The formula I'm trying to use is below and failing muiserably. Can anyone help me figure out what is wrong here....

<TABLE style="BACKGROUND-COLOR: #ffffff; PADDING-LEFT: 2pt; PADDING-RIGHT: 2pt; FONT-FAMILY: Calibri,Arial; FONT-SIZE: 11pt" border=1 cellSpacing=0 cellPadding=0><COLGROUP><COL style="WIDTH: 30px; FONT-WEIGHT: bold"><COL style="WIDTH: 73px"><COL style="WIDTH: 47px"><COL style="WIDTH: 27px"><COL style="WIDTH: 73px"><COL style="WIDTH: 59px"></COLGROUP><TBODY><TR style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt; FONT-WEIGHT: bold"><TD> </TD><TD>U</TD><TD>V</TD><TD>W</TD><TD>X</TD><TD>Y</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">1</TD><TD> </TD><TD> </TD><TD> </TD><TD>Week1</TD><TD> </TD></TR><TR style="HEIGHT: 33px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">2</TD><TD style="FONT-FAMILY: Arial; COLOR: #ff0000; FONT-SIZE: 10pt; FONT-WEIGHT: bold">This Week</TD><TD style="FONT-FAMILY: Arial; COLOR: #ff0000; FONT-SIZE: 10pt; FONT-WEIGHT: bold"> </TD><TD style="FONT-FAMILY: Arial; COLOR: #ff0000; FONT-SIZE: 10pt; FONT-WEIGHT: bold"> </TD><TD style="FONT-FAMILY: Arial; COLOR: #ff0000; FONT-SIZE: 10pt; FONT-WEIGHT: bold">Last Week</TD><TD> </TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">3</TD><TD style="TEXT-ALIGN: right">297788</TD><TD style="TEXT-ALIGN: center">1</TD><TD> </TD><TD style="TEXT-ALIGN: right">297788</TD><TD> </TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">4</TD><TD style="TEXT-ALIGN: right">274840</TD><TD style="TEXT-ALIGN: center">2</TD><TD> </TD><TD style="TEXT-ALIGN: right">274840</TD><TD> </TD></TR></TBODY></TABLE>
<TABLE style="BORDER-BOTTOM-STYLE: groove; BORDER-BOTTOM-COLOR: #00ff00; BORDER-RIGHT-STYLE: groove; BACKGROUND-COLOR: #fffcf9; BORDER-TOP-COLOR: #00ff00; FONT-FAMILY: Arial; BORDER-TOP-STYLE: groove; COLOR: #000000; BORDER-RIGHT-COLOR: #00ff00; FONT-SIZE: 10pt; BORDER-LEFT-STYLE: groove; BORDER-LEFT-COLOR: #00ff00"><TBODY><TR><TD>Spreadsheet Formulas</TD></TR><TR><TD><TABLE style="FONT-FAMILY: Arial; FONT-SIZE: 9pt" border=1 cellSpacing=0 cellPadding=2><TBODY><TR style="BACKGROUND-COLOR: #cacaca; FONT-SIZE: 10pt"><TD>Cell</TD><TD>Formula</TD></TR><TR><TD>V3</TD><TD>=IF(C3="","",IF(ISNA(VLOOKUP($U3,$C$3:$H$7021,6,FALSE)),"",VLOOKUP($U3,$C$3:$H$7021,6,FALSE)))</TD></TR><TR><TD>X3</TD><TD>=IF(INDIRECT($X$1&"!U"&ROW())>0,INDIRECT($X$1&"!U"&ROW()),"")</TD></TR><TR><TD>Y3</TD><TD>=IF(COUNTIF(INDIRECT(X1&"!"&"$u$2:$v$14500"),X1), VLOOKUP(X3,INDIRECT(X1&"!"&"$u$2:$v$14500"),2,0),"")</TD></TR><TR><TD>V4</TD><TD>=IF(C4="","",IF(ISNA(VLOOKUP($U4,$C$3:$H$7021,6,FALSE)),"",VLOOKUP($U4,$C$3:$H$7021,6,FALSE)))</TD></TR><TR><TD>X4</TD><TD>=IF(INDIRECT($X$1&"!U"&ROW())>0,INDIRECT($X$1&"!U"&ROW()),"")</TD></TR><TR><TD>Y4</TD><TD>=IF(AI5="","",VLOOKUP(X4,$AI$4:$AJ$5938,2,FALSE))</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi Alex,

I'm not an expert and this may not be the best solution but it appears to work...


Excel Workbook
UV
1ID NumberName
2AA10000Bart Simpson
3AA10001Lisa Simpson
4AA10002Grandpa Simpson
5AA10003Lisa Simpson
6AA10004Marge Simpson
7AA10005Maggie Simpson
8AA10006Milhouse Van Houten
9AA10007Ned Flanders
10AA10008Otto Mann
11AA10009Rod Flanders
12AA10010Tod Flanders
13AA10011Bart Simpson
14AA10012Moe Szyslak
15AA10013Grandpa Simpson
16AA10014Lisa Simpson
17AA10015Marge Simpson
18AA10016Maggie Simpson
19AA10017Bart Simpson
20AA10018Lisa Simpson
Week1



Excel Workbook
XY
1Week1*
2ID NumberName
3AA10002Grandpa Simpson
4AA10011Bart Simpson
Result


I hope that helps give you some idea if not a solution.

Ak
 
Upvote 0
Akashwani has the correct formula, however it does not need to be array entered. Just use:

=INDEX(INDIRECT("'"&$X$1&"'!$V$2:$V$14500"),MATCH($X3,INDIRECT("'"&$X$1&"'!$U$2:$U$14500"),0))
 
Upvote 0
Your formula in Y3 is wrong

=IF(COUNTIF(INDIRECT(X1&"!"&"$u$2:$v$14500"),X1), VLOOKUP(X3,INDIRECT(X1&"!"&"$u$2:$v$14500"),2,0),"")

It look like X1 Should be X3
 
Upvote 0
Hi Keith,

I didn't realise I'd done ctrl shift enter :rofl:

How's the new job?
I hope everything is going well for you.

Ak
 
Upvote 0
Thanks for all of the input! Much appreciated, Akashwani. Your solution worked perfectly!

Cheers
 
Upvote 0
Hi Keith,

I didn't realise I'd done ctrl shift enter :rofl:

How's the new job?
I hope everything is going well for you.

Ak

Things are fantastic. Loving it; though it definitely doesn't give me enough time to help on the forums during the day. :biggrin:
 
Upvote 0

Forum statistics

Threads
1,224,558
Messages
6,179,512
Members
452,921
Latest member
BBQKING

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top