View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
NickH NickH is offline
external usenet poster
 
Posts: 60
Default Need array formula to ignore hidden values

In case it helps anyone else; I've worked out a way round this by
using a UDF...

Public Function IsVisible(ByVal Target As Range)
Dim i As Long
Dim ArrVisible()

ReDim ArrVisible(1 To Target.Rows.Count)
For i = LBound(ArrVisible) To UBound(ArrVisible)
ArrVisible(i) = Not Target.Rows(i).EntireRow.Hidden
Next i
IsVisible = Application.WorksheetFunction.Transpose(ArrVisible )
End Function

The new formula looks like this...
=SUM(IsVisible(NR_DataType_List)*(NR_DataType_List =
$AC77)*(INDIRECT(ADDRESS(NRc_TopRow,COLUMN())):IND IRECT(ADDRESS(NRc_BotRow,COLUMN()))))

However, this does slow calculation down a little so if anyone knows
of a non-UDF solution I'd be glad to see it.

Br, Nick.