Using combination of LOOKUP and INDIRECT

blacklab1059

New Member
Joined
Oct 10, 2006
Messages
8
I have multiple sheets - 1 is an index and the rest are project sheets 1801, 1802, 1803....
The index has a column "B" that lists all the project sheet names.
I am trying to determine the last populated date in each project sheet - also column B.
I am able to determine the last populated date with the following formula: =LOOKUP(2,1/('1819'!B:B<>""),'1819'!B:B) ~1819 is the project sheet.
I want to dynamically populate the project sheet # (1819) from the index column B.
I have successfully modified the second half of the formula as such: =LOOKUP(2,1/('1819'!B:B<>""),INDIRECT(B21&"!B:B"))
I am unable to get INDIRECT to work for the first half of the formula: =LOOKUP(2,1/('1819'!B:B<>"") to show the value of B21 (1819).
I have done a pretty thorough search but have been unable to come up with a solution.
Thoughts?
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hello,

Have you tested the following :

Code:
=LOOKUP(2,1/(INDIRECT(B21&"!B:B")<>""),INDIRECT(B21&"!B:B"))

Hope this will help
 
Upvote 0
It's much faster if you invoke

=LOOKUP(9.99999999999999E+307,INDIRECT(B21&"!B:B"))

where B21 is a sheet name.
 
Upvote 0
@ Aladin,

If I am not mistaken ... there is a difference between Text and Values ...
 
Upvote 0
@ Aladin,

If I am not mistaken ... there is a difference between Text and Values ...

OP: "I am trying to determine the last populated date in each project sheet - also column B."

If it's text, I'd suggest...

=LOOKUP(REPT("z",255),INDIRECT(B21&"!B:B"))
 
Upvote 0
@ Aladin,

Thanks for your insight ...

Does it mean that OP's formula is only to be used in generic cases ... whenever one does not know if he will retrieving Text or Value ...
 
Upvote 0
@ Aladin,

Thanks for your insight ...

Does it mean that OP's formula is only to be used in generic cases ... whenever one does not know if he will retrieving Text or Value ...

In case the last value what we are after can be one of numeric, text, logicals...

Either:
=LOOKUP(9.99999999999999E+307,1/(B2:B7<>""),B2:B7)

Or:
=LOOKUP(9.99999999999999E+307,SEARCH("?*",B2:B7),B2:B7)

If the last value can be anything, including a formula blank...

=LOOKUP(9.99999999999999E+307,1/(1-ISBLANK(B2:B7)),B2:B7)
 
Upvote 0
@ Aladin,

Thanks a lot for your complete explanation ...:smile:
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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