ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Condition for worksheet reference (https://www.excelbanter.com/excel-worksheet-functions/210669-condition-worksheet-reference.html)

JBoyer

Condition for worksheet reference
 
This is the function I currently have:
=IF(L2<"",INDIRECT("'"&L2&"'!B"&ROW($A$2)),"")

I want to modify it in the following way....
=IF(L2<"", {IF STATEMENT} INDIRECT("'"&L2&"'!B"&ROW($A$2)),"")

I want to add another if statement where shown above to check if there is a
sheet called '"&L2&'"! . So basically IF('"&L2&'"! EXISTS, TRUE, FALSE)

Thanks in advance for any help!

Max

Condition for worksheet reference
 
Think IF(ISERROR(..) could be used

Try it in this manner:
=IF(L2="","",IF(ISERROR(INDIRECT("'"&L2&"'!B"&ROW( $A$2))),"",INDIRECT("'"&L2&"'!B"&ROW($A$2))))
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:20,500 Files:363 Subscribers:64
xdemechanik
---
"JBoyer" wrote:
This is the function I currently have:
=IF(L2<"",INDIRECT("'"&L2&"'!B"&ROW($A$2)),"")

I want to modify it in the following way....
=IF(L2<"", {IF STATEMENT} INDIRECT("'"&L2&"'!B"&ROW($A$2)),"")

I want to add another if statement where shown above to check if there is a
sheet called '"&L2&'"! . So basically IF('"&L2&'"! EXISTS, TRUE, FALSE)

Thanks in advance for any help!


JBoyer

Condition for worksheet reference
 
Nice Work.
THANKS!

"Max" wrote:

Think IF(ISERROR(..) could be used

Try it in this manner:
=IF(L2="","",IF(ISERROR(INDIRECT("'"&L2&"'!B"&ROW( $A$2))),"",INDIRECT("'"&L2&"'!B"&ROW($A$2))))
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:20,500 Files:363 Subscribers:64
xdemechanik
---
"JBoyer" wrote:
This is the function I currently have:
=IF(L2<"",INDIRECT("'"&L2&"'!B"&ROW($A$2)),"")

I want to modify it in the following way....
=IF(L2<"", {IF STATEMENT} INDIRECT("'"&L2&"'!B"&ROW($A$2)),"")

I want to add another if statement where shown above to check if there is a
sheet called '"&L2&'"! . So basically IF('"&L2&'"! EXISTS, TRUE, FALSE)

Thanks in advance for any help!


T. Valko

Condition for worksheet reference
 
That'll work but there is a caveat.

This would probably only apply if you're using the default sheet names.

If the sheet already exists then it's no problem. If the sheet does not
exist and you insert a new sheet the formula will not update until some
event triggers a calculation (like renaming a newly inserted sheet!).
Deleting the sheet referenced will trigger a calcualtion and the formula
would update.

--
Biff
Microsoft Excel MVP


"Max" wrote in message
...
Think IF(ISERROR(..) could be used

Try it in this manner:
=IF(L2="","",IF(ISERROR(INDIRECT("'"&L2&"'!B"&ROW( $A$2))),"",INDIRECT("'"&L2&"'!B"&ROW($A$2))))
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:20,500 Files:363 Subscribers:64
xdemechanik
---
"JBoyer" wrote:
This is the function I currently have:
=IF(L2<"",INDIRECT("'"&L2&"'!B"&ROW($A$2)),"")

I want to modify it in the following way....
=IF(L2<"", {IF STATEMENT} INDIRECT("'"&L2&"'!B"&ROW($A$2)),"")

I want to add another if statement where shown above to check if there is
a
sheet called '"&L2&'"! . So basically IF('"&L2&'"! EXISTS, TRUE, FALSE)

Thanks in advance for any help!




Max

Condition for worksheet reference
 
Welcome, thanks.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:20,500 Files:363 Subscribers:64
xdemechanik
---
"JBoyer" wrote:
Nice Work.
THANKS!



JBoyer

Condition for worksheet reference
 
Thanks for the info.

"T. Valko" wrote:

That'll work but there is a caveat.

This would probably only apply if you're using the default sheet names.

If the sheet already exists then it's no problem. If the sheet does not
exist and you insert a new sheet the formula will not update until some
event triggers a calculation (like renaming a newly inserted sheet!).
Deleting the sheet referenced will trigger a calcualtion and the formula
would update.

--
Biff
Microsoft Excel MVP


"Max" wrote in message
...
Think IF(ISERROR(..) could be used

Try it in this manner:
=IF(L2="","",IF(ISERROR(INDIRECT("'"&L2&"'!B"&ROW( $A$2))),"",INDIRECT("'"&L2&"'!B"&ROW($A$2))))
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:20,500 Files:363 Subscribers:64
xdemechanik
---
"JBoyer" wrote:
This is the function I currently have:
=IF(L2<"",INDIRECT("'"&L2&"'!B"&ROW($A$2)),"")

I want to modify it in the following way....
=IF(L2<"", {IF STATEMENT} INDIRECT("'"&L2&"'!B"&ROW($A$2)),"")

I want to add another if statement where shown above to check if there is
a
sheet called '"&L2&'"! . So basically IF('"&L2&'"! EXISTS, TRUE, FALSE)

Thanks in advance for any help!






All times are GMT +1. The time now is 07:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com