Jerry Sullivan
MrExcel MVP
- Joined
- Mar 18, 2010
- Messages
- 8,787
I'm trying to implement Chip Pearson's isVisible UDF to Sum only visible cells.
http://www.cpearson.com/excel/IsVisible.aspx
I'm finding that the Array formula recalculates automatically when Rows are Hidden and Unhidden.
However the Array formula does not recalculate when Columns are Hidden or Unhidden.
In fact, even if I click Calculate Now (F9), the value does not recalculate.
The formula recalculates if I change one of the inuput variables change, or if Application.Volatile is added to the UDF the formula recalculates on any change to the worksheet.
Strangely, Formula Auditing > Evaluate Formula shows this analysis:
SUM(isVisible(C1:H1)*C1:H1)
SUM({TRUE,FALSE,FALSE,FALSE,TRUE,TRUE}*C1:H1)
SUM({1,0,0,0,5,6})
21
Does anyone know why this is happening and a possible fix?
Note that my Columns are Hidden (not Filtered) so SubTotal will not work.
Thanks in advance!
http://www.cpearson.com/excel/IsVisible.aspx
I'm finding that the Array formula recalculates automatically when Rows are Hidden and Unhidden.
However the Array formula does not recalculate when Columns are Hidden or Unhidden.
Excel Workbook | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
1 | 21 | 1 | 2 | 3 | 4 | 5 | 6 | |||
Before Hiding D-F |
Excel Workbook | |||||||
---|---|---|---|---|---|---|---|
A | B | C | G | H | |||
1 | 21 | 1 | 5 | 6 | |||
After Hiding D-F |
In fact, even if I click Calculate Now (F9), the value does not recalculate.
The formula recalculates if I change one of the inuput variables change, or if Application.Volatile is added to the UDF the formula recalculates on any change to the worksheet.
Strangely, Formula Auditing > Evaluate Formula shows this analysis:
SUM(isVisible(C1:H1)*C1:H1)
SUM({TRUE,FALSE,FALSE,FALSE,TRUE,TRUE}*C1:H1)
SUM({1,0,0,0,5,6})
21
Does anyone know why this is happening and a possible fix?
Note that my Columns are Hidden (not Filtered) so SubTotal will not work.
Thanks in advance!