How to use Concatenate result in Vlookup

rrosenwald

New Member
Joined
Jul 7, 2012
Messages
7
I'm running Excel 2007

I have three related questions here.

I have a concatenate: CONCATENATE(ADDRESS(MATCH(TODAY()-1,A:A,0)+1,3),":",ADDRESS(MATCH(TODAY(),A:A,0),6))

that yields a result like: $C$927:$F$1742

but: VLOOKUP(C1124,CONCATENATE(ADDRESS(MATCH(TODAY()-1,A:A,0)+1,3),":",ADDRESS(MATCH(TODAY(),A:A,0),6)),4,FALSE)

yields: #N/A

althhough: VLOOKUP(C1124,$C$927:$F$1742,4,FALSE)

yields the correct result.

Question 1: How do I use the CONCATENATE(ADDRESS(MATCH(TODAY()-1,A:A,0)+1,3),":",ADDRESS(MATCH(TODAY(),A:A,0),6)) inside a VLOOKUP?

Question 2: How would I do this within VBA?

Question 3: Would it be better to create a UDF Cell_Range() and how might that be written?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Select the cell that contains your =Concatenate() formula, then click the Formula Tab, then in the Formula auditing group "Evaluate Formula";
As you step thru what seems to be the problem?
 
Upvote 0
I'm running Excel 2007

I have three related questions here.

I have a concatenate: CONCATENATE(ADDRESS(MATCH(TODAY()-1,A:A,0)+1,3),":",ADDRESS(MATCH(TODAY(),A:A,0),6))

that yields a result like: $C$927:$F$1742

but: VLOOKUP(C1124,CONCATENATE(ADDRESS(MATCH(TODAY()-1,A:A,0)+1,3),":",ADDRESS(MATCH(TODAY(),A:A,0),6)),4,FALSE)

yields: #N/A

althhough: VLOOKUP(C1124,$C$927:$F$1742,4,FALSE)

yields the correct result.

Question 1: How do I use the CONCATENATE(ADDRESS(MATCH(TODAY()-1,A:A,0)+1,3),":",ADDRESS(MATCH(TODAY(),A:A,0),6)) inside a VLOOKUP?

Question 2: How would I do this within VBA?

Question 3: Would it be better to create a UDF Cell_Range() and how might that be written?
This is a better way to define the range:

INDEX(C:C,MATCH(TODAY()-1,A:A,0)+1):INDEX(F:F,MATCH(TODAY(),A:A,0))

Then, your lookup formula would be:

=VLOOKUP(C1124,INDEX(C:C,MATCH(TODAY()-1,A:A,0)+1):INDEX(F:F,MATCH(TODAY(),A:A,0)),4,0)

Even better, use a cell to hold =TODAY()...

B1: =TODAY()

Then:

=VLOOKUP(C1124,INDEX(C:C,MATCH(B1-1,A:A,0)+1):INDEX(F:F,MATCH(B1,A:A,0)),4,0)
 
Upvote 0

Forum statistics

Threads
1,214,416
Messages
6,119,386
Members
448,891
Latest member
tpierce

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