#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default IF function

How can I use an IF function to look for a worksheet name and then look for a
specific cell and return the value in that cell. And if the worksheet is not
found, return a value of zero?
Example: Worksheet AB, cell B1, if not found return value of zero.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default IF function

=IF(ISERROR(INDIRECT("'Worksheet AB'!B1")),0,INDIRECT("'Worksheet AB'!B1"))

Note the single quoation marks around the sheet name.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"wcurtis" wrote:

How can I use an IF function to look for a worksheet name and then look for a
specific cell and return the value in that cell. And if the worksheet is not
found, return a value of zero?
Example: Worksheet AB, cell B1, if not found return value of zero.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default IF function

Hi,

Technically you can write a formula such as this.

=IF(ISERR(shane2!C6),0,shane2!C6)

It will show a result of 0 until Shane2 exists, then it will pick of the
value in that sheet. If you're worried about deleting sheets permanately
then it works also but the formula now show a #REF on the formula bar.

But if you are worried about deleting sheets and possible readding them then
don't use this formula because it will not be prepared when you add back the
sheet.

=IF(ISERR(INDIRECT("shane2!C6")),0,INDIRECT("shane 2!C6"))
or in 2007
=IFERROR(INDIRECT("shane2!C6"),0)

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"wcurtis" wrote:

How can I use an IF function to look for a worksheet name and then look for a
specific cell and return the value in that cell. And if the worksheet is not
found, return a value of zero?
Example: Worksheet AB, cell B1, if not found return value of zero.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default IF function

I am getting an error when I write in the formula. I am worried about taking
a sheet away and then putting in back in later. I want the cell to show 0 if
the sheet is not there.
I would ultimately like it if I had a template sheet that I could just copy
into any workbook and it would autopopulate. I have 22 to 28 worksheets that
have several lines of info I need.

"Shane Devenshire" wrote:

Hi,

Technically you can write a formula such as this.

=IF(ISERR(shane2!C6),0,shane2!C6)

It will show a result of 0 until Shane2 exists, then it will pick of the
value in that sheet. If you're worried about deleting sheets permanately
then it works also but the formula now show a #REF on the formula bar.

But if you are worried about deleting sheets and possible readding them then
don't use this formula because it will not be prepared when you add back the
sheet.

=IF(ISERR(INDIRECT("shane2!C6")),0,INDIRECT("shane 2!C6"))
or in 2007
=IFERROR(INDIRECT("shane2!C6"),0)

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"wcurtis" wrote:

How can I use an IF function to look for a worksheet name and then look for a
specific cell and return the value in that cell. And if the worksheet is not
found, return a value of zero?
Example: Worksheet AB, cell B1, if not found return value of zero.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default IF function

You could use something like this

=IF(ISERROR(Sheet8!B1),0,Sheet8!B1)

But that would mask all errors.

i.e. you might have the correct sheet but if B1 contains an error you will
still get a 0


Gord Dibben MS Excel MVP




On Thu, 8 Jan 2009 12:49:02 -0800, wcurtis
wrote:

How can I use an IF function to look for a worksheet name and then look for a
specific cell and return the value in that cell. And if the worksheet is not
found, return a value of zero?
Example: Worksheet AB, cell B1, if not found return value of zero.


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
ISBLANK function not working when cell is blank dut to function re mcmilja Excel Discussion (Misc queries) 9 May 7th 23 03:43 AM
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM


All times are GMT +1. The time now is 08:27 PM.

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"