Try this UDF:
Function PartsPerSheet(PartNum As Variant)
Dim i As Integer, lPartCountWS As Long, lPartCountWB As Long, iSheetCount As Integer
On Error GoTo ErrCatch
Application.Volatile
For i = 4 To Worksheets.Count
lPartCountWS = WorksheetFunction.CountIf(Worksheets(i).UsedRange, PartNum)
If lPartCountWS > 0 Then
lPartCountWB = lPartCountWB + lPartCountWS
iSheetCount = iSheetCount + 1
End If
Next i
If iSheetCount = 0 Then
PartsPerSheet = 0
Else
PartsPerSheet = lPartCountWB / iSheetCount
End If
Exit Function
ErrCatch:
PartsPerSheet = CVErr(xlErrRef)
End Function
Use as:
Formula:
=PartsPerSheet('Survey Template'!A101)
Note that it will only work on the first three sheets - use on sheet 4 onwards will result in a circular reference.
Bookmarks