If my understanding is correct:
Sub AverageWash()
Dim c As Range
Dim path As String
path = Worksheets("Legend").Range("I3")
Sheets("AverageWash").Visible = True
Sheets("AverageWash").Activate
Call GetFileDetailsAW
For Each c In Range("A3", Cells(Rows.count, "A").End(xlUp))
If IsFile(path & c.Value) Then c.Offset(0, 8).Formula = "='" & path & "[" & c.Value & "]" & "Setup'!$P$14"
Next c
Call AverageWash2
End Sub
Function IsFile(ByVal fName As String) As Boolean
'Returns TRUE if the provided name points to an existing file.
'Returns FALSE if not existing, or if it's a folder
On Error Resume Next
IsFile = ((GetAttr(fName) And vbDirectory) <> vbDirectory)
On Error GoTo 0
End Function
Bookmarks