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?
 

Some videos you may like

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,478
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?
 

rrosenwald

New Member
Joined
Jul 7, 2012
Messages
7
Thank you. I see my problem - Today() doesn't work real well with yesterday's data:)
 

T. Valko

Well-known Member
Joined
May 9, 2009
Messages
16,623
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)
 

Watch MrExcel Video

Forum statistics

Threads
1,122,262
Messages
5,595,161
Members
413,972
Latest member
emiguy

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
Top