#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 58
Default Formula Error


In the formula below I'm checking to see if a file exits. If it doesn't
then zero is suppose to be the value in the cell. If the file does exists
then it's suppose to supply the value from a cell in one of the worksheets of
the file.
I keep getting the "#REF" error which then throws the rest of my
calculations into a tail spin. What am I doing wrong here?

=IF(ISERROR("\\PANTHER\depts\TechnicalServices\Dai ly Status
Report\History\[IT Daily Status 061208.xls]"),0,
'\\PANTHER\depts\TechnicalServices\Daily Status Report\History\[IT Daily
Status 061208.xls]Executive Summary'!$C$30)
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 329
Default Formula Error

Hi El Bee,

The problem you're having is that your formula is testing the quoted string,
not for the presence of a file.

To test for a file you need some vba. Here's a suitable function:

Application.Volatile

Function WkBkExists(WkBk As String)
If InStr(1, WkBk, "[") Then
WkBk = Left(WkBk, InStr(1, WkBk, "[") - 1)
End If
If Dir(WkBk, vbNormal) = "" Then
WkBkExists = False
Else
WkBkExists = True
End If
End Function

To use this function:
.. open your Excel Workbook
.. press Alt-F11 to open the vba editor
.. insert a code module
.. copy the code & paste it into your module
.. press Alt-F11 again to return to the workbook
.. code your formula as:
=IF(WkBkExists('\\PANTHER\depts\TechnicalServices\ Daily Status
Report\History\[IT Daily Status 061208.xls]Executive
Summary'!$C$30),"\\PANTHER\depts\TechnicalServices \Daily Status
Report\History\[IT Daily Status 061208.xls]Executive Summary'!$C$30",0)

Cheers

--
macropod
[MVP - Microsoft Word]


"El Bee" wrote in message
...

In the formula below I'm checking to see if a file exits. If it doesn't
then zero is suppose to be the value in the cell. If the file does exists
then it's suppose to supply the value from a cell in one of the worksheets

of
the file.
I keep getting the "#REF" error which then throws the rest of my
calculations into a tail spin. What am I doing wrong here?

=IF(ISERROR("\\PANTHER\depts\TechnicalServices\Dai ly Status
Report\History\[IT Daily Status 061208.xls]"),0,
'\\PANTHER\depts\TechnicalServices\Daily Status Report\History\[IT Daily
Status 061208.xls]Executive Summary'!$C$30)



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 329
Default Formula Error

Actually, the formula could be reduced to:
=IF(WkBkExists('\\PANTHER\depts\TechnicalServices\ Daily Status
Report\History\IT Daily Status
061208.xls),"\\PANTHER\depts\TechnicalServices\Dai ly Status
Report\History\[IT Daily Status 061208.xls]Executive Summary'!$C$30",0)
All you really need is the path & filename.

Cheers

--
macropod
[MVP - Microsoft Word]


"macropod" wrote in message
...
Hi El Bee,

The problem you're having is that your formula is testing the quoted

string,
not for the presence of a file.

To test for a file you need some vba. Here's a suitable function:

Application.Volatile

Function WkBkExists(WkBk As String)
If InStr(1, WkBk, "[") Then
WkBk = Left(WkBk, InStr(1, WkBk, "[") - 1)
End If
If Dir(WkBk, vbNormal) = "" Then
WkBkExists = False
Else
WkBkExists = True
End If
End Function

To use this function:
. open your Excel Workbook
. press Alt-F11 to open the vba editor
. insert a code module
. copy the code & paste it into your module
. press Alt-F11 again to return to the workbook
. code your formula as:
=IF(WkBkExists('\\PANTHER\depts\TechnicalServices\ Daily Status
Report\History\[IT Daily Status 061208.xls]Executive
Summary'!$C$30),"\\PANTHER\depts\TechnicalServices \Daily Status
Report\History\[IT Daily Status 061208.xls]Executive Summary'!$C$30",0)

Cheers

--
macropod
[MVP - Microsoft Word]


"El Bee" wrote in message
...

In the formula below I'm checking to see if a file exits. If it doesn't
then zero is suppose to be the value in the cell. If the file does

exists
then it's suppose to supply the value from a cell in one of the

worksheets
of
the file.
I keep getting the "#REF" error which then throws the rest of my
calculations into a tail spin. What am I doing wrong here?

=IF(ISERROR("\\PANTHER\depts\TechnicalServices\Dai ly Status
Report\History\[IT Daily Status 061208.xls]"),0,
'\\PANTHER\depts\TechnicalServices\Daily Status Report\History\[IT Daily
Status 061208.xls]Executive Summary'!$C$30)





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 329
Default Formula Error

A correction:
The line
Application.Volatile
should apear after the line
Function WkBkExists(WkBk As String)

Cheers

--
macropod
[MVP - Microsoft Word]


"macropod" wrote in message
...
Hi El Bee,

The problem you're having is that your formula is testing the quoted

string,
not for the presence of a file.

To test for a file you need some vba. Here's a suitable function:

Application.Volatile

Function WkBkExists(WkBk As String)
If InStr(1, WkBk, "[") Then
WkBk = Left(WkBk, InStr(1, WkBk, "[") - 1)
End If
If Dir(WkBk, vbNormal) = "" Then
WkBkExists = False
Else
WkBkExists = True
End If
End Function

To use this function:
. open your Excel Workbook
. press Alt-F11 to open the vba editor
. insert a code module
. copy the code & paste it into your module
. press Alt-F11 again to return to the workbook
. code your formula as:
=IF(WkBkExists('\\PANTHER\depts\TechnicalServices\ Daily Status
Report\History\[IT Daily Status 061208.xls]Executive
Summary'!$C$30),"\\PANTHER\depts\TechnicalServices \Daily Status
Report\History\[IT Daily Status 061208.xls]Executive Summary'!$C$30",0)

Cheers

--
macropod
[MVP - Microsoft Word]


"El Bee" wrote in message
...

In the formula below I'm checking to see if a file exits. If it doesn't
then zero is suppose to be the value in the cell. If the file does

exists
then it's suppose to supply the value from a cell in one of the

worksheets
of
the file.
I keep getting the "#REF" error which then throws the rest of my
calculations into a tail spin. What am I doing wrong here?

=IF(ISERROR("\\PANTHER\depts\TechnicalServices\Dai ly Status
Report\History\[IT Daily Status 061208.xls]"),0,
'\\PANTHER\depts\TechnicalServices\Daily Status Report\History\[IT Daily
Status 061208.xls]Executive Summary'!$C$30)





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 329
Default Formula Error

And another correction. Sorry 'bout this. Here's the complete function:

Function WkBkExists(WkBk As String)
Application.Volatile
If InStr(1, WkBk, "[") < 0 Then
WkBk = Replace(Left(WkBk, InStr(1, WkBk, "]") - 1), "[", "")
End If
If Dir(WkBk, vbNormal) = "" Then
FileExists = False
Else
FileExists = True
End If
End Function

Cheers

--
macropod
[MVP - Microsoft Word]


"macropod" wrote in message
...
Hi El Bee,

The problem you're having is that your formula is testing the quoted

string,
not for the presence of a file.

To test for a file you need some vba. Here's a suitable function:

Application.Volatile

Function WkBkExists(WkBk As String)
If InStr(1, WkBk, "[") Then
WkBk = Left(WkBk, InStr(1, WkBk, "[") - 1)
End If
If Dir(WkBk, vbNormal) = "" Then
WkBkExists = False
Else
WkBkExists = True
End If
End Function

To use this function:
. open your Excel Workbook
. press Alt-F11 to open the vba editor
. insert a code module
. copy the code & paste it into your module
. press Alt-F11 again to return to the workbook
. code your formula as:
=IF(WkBkExists('\\PANTHER\depts\TechnicalServices\ Daily Status
Report\History\[IT Daily Status 061208.xls]Executive
Summary'!$C$30),"\\PANTHER\depts\TechnicalServices \Daily Status
Report\History\[IT Daily Status 061208.xls]Executive Summary'!$C$30",0)

Cheers

--
macropod
[MVP - Microsoft Word]


"El Bee" wrote in message
...

In the formula below I'm checking to see if a file exits. If it doesn't
then zero is suppose to be the value in the cell. If the file does

exists
then it's suppose to supply the value from a cell in one of the

worksheets
of
the file.
I keep getting the "#REF" error which then throws the rest of my
calculations into a tail spin. What am I doing wrong here?

=IF(ISERROR("\\PANTHER\depts\TechnicalServices\Dai ly Status
Report\History\[IT Daily Status 061208.xls]"),0,
'\\PANTHER\depts\TechnicalServices\Daily Status Report\History\[IT Daily
Status 061208.xls]Executive Summary'!$C$30)







  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 329
Default Formula Error

This time for sure ...

Function WkBkExists(WkBk As String)
Application.Volatile
If InStr(1, WkBk, "[") < 0 Then
WkBk = Replace(Left(WkBk, InStr(1, WkBk, "]") - 1), "[", "")
End If
If Dir(WkBk, vbNormal) = "" Then
WkBkExists = False
Else
WkBkExists = True
End If
End Function


Cheers
--
macropod
[MVP - Microsoft Word]


"macropod" wrote in message
...
And another correction. Sorry 'bout this. Here's the complete function:

Function WkBkExists(WkBk As String)
Application.Volatile
If InStr(1, WkBk, "[") < 0 Then
WkBk = Replace(Left(WkBk, InStr(1, WkBk, "]") - 1), "[", "")
End If
If Dir(WkBk, vbNormal) = "" Then
FileExists = False
Else
FileExists = True
End If
End Function

Cheers

--
macropod
[MVP - Microsoft Word]


"macropod" wrote in message
...
Hi El Bee,

The problem you're having is that your formula is testing the quoted

string,
not for the presence of a file.

To test for a file you need some vba. Here's a suitable function:

Application.Volatile

Function WkBkExists(WkBk As String)
If InStr(1, WkBk, "[") Then
WkBk = Left(WkBk, InStr(1, WkBk, "[") - 1)
End If
If Dir(WkBk, vbNormal) = "" Then
WkBkExists = False
Else
WkBkExists = True
End If
End Function

To use this function:
. open your Excel Workbook
. press Alt-F11 to open the vba editor
. insert a code module
. copy the code & paste it into your module
. press Alt-F11 again to return to the workbook
. code your formula as:
=IF(WkBkExists('\\PANTHER\depts\TechnicalServices\ Daily Status
Report\History\[IT Daily Status 061208.xls]Executive
Summary'!$C$30),"\\PANTHER\depts\TechnicalServices \Daily Status
Report\History\[IT Daily Status 061208.xls]Executive Summary'!$C$30",0)

Cheers

--
macropod
[MVP - Microsoft Word]


"El Bee" wrote in message
...

In the formula below I'm checking to see if a file exits. If it

doesn't
then zero is suppose to be the value in the cell. If the file does

exists
then it's suppose to supply the value from a cell in one of the

worksheets
of
the file.
I keep getting the "#REF" error which then throws the rest of my
calculations into a tail spin. What am I doing wrong here?

=IF(ISERROR("\\PANTHER\depts\TechnicalServices\Dai ly Status
Report\History\[IT Daily Status 061208.xls]"),0,
'\\PANTHER\depts\TechnicalServices\Daily Status Report\History\[IT

Daily
Status 061208.xls]Executive Summary'!$C$30)







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
Find value in array Brook6 Excel Worksheet Functions 26 January 30th 07 09:40 PM
Formula Error DavidB New Users to Excel 10 October 19th 06 06:12 AM
Formula Recalculation Error uknow message board Excel Worksheet Functions 2 September 21st 06 05:33 PM
Let me save/close EXCEL if a formula I put in has an error in it Tony Borg Setting up and Configuration of Excel 1 September 2nd 06 04:13 AM
I get error with "ROWS" in the formula - nested formula question Marie J-son Excel Worksheet Functions 0 January 4th 06 01:55 PM


All times are GMT +1. The time now is 12:36 AM.

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

About Us

"It's about Microsoft Excel"