Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 72
Default 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!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default 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!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 72
Default 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!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default 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!



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default 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!




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 72
Default 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!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting rows in a worksheet if condition is met destine Excel Discussion (Misc queries) 3 November 20th 08 01:39 PM
copy row content from one worksheet to another, if a condition met Lorilenore Excel Worksheet Functions 2 May 24th 08 08:36 PM
copy data from 1 worksheet to another based on a condition [email protected] Excel Worksheet Functions 9 September 4th 06 02:45 PM
External reference as a condition Ingeniero1 Excel Worksheet Functions 0 November 12th 04 09:42 PM
External reference as a condition Ingeniero1 Excel Worksheet Functions 2 November 12th 04 07:10 PM


All times are GMT +1. The time now is 06:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"