![]() |
Subtotal function for hidden row
I have got a multisheets database where both rows and columns may be
hidden according to a given criteria. Only blanks rows and columns should be hidden. Now I need a formula to check if there is no "valuable" data hidden. Checking test might be: SUBTOTAL(9,reference) = SUBTOTAL(109,reference) The problem is that it works for rows only and not for the columns. Any ideas? Thanks in advance Tomek |
Hi
One way to deal with your columns would be =COUNT(A1:X1)<COLUMN(X:X)+1-COLUMN(A:A) This would return TRUE if there are no values in the hidden columns. Regards Roger Govier wrote: I have got a multisheets database where both rows and columns may be hidden according to a given criteria. Only blanks rows and columns should be hidden. Now I need a formula to check if there is no "valuable" data hidden. Checking test might be: SUBTOTAL(9,reference) = SUBTOTAL(109,reference) The problem is that it works for rows only and not for the columns. Any ideas? Thanks in advance Tomek |
It seems that Count doesn't take into account whether a cell is hidden
or not. It counts it anyway... |
|
Hi
Agreed, but that is useful. If the value returned by Count is the same as the value returned by counting the used column range, then there must be data in every cell, then the returned value would be FALSE If some of those cells (columns) are Hidden, this means your hidden columns did contain data. Regards Roger Govier wrote: It seems that Count doesn't take into account whether a cell is hidden or not. It counts it anyway... |
Thanks. This method is well useful but I find it little convenient. I
mean for each of 50 columns I should have 50 rows with "Visible status". This strange geometry does not look good to me. I was rather thinking of a "magic formula" in one cell with the clear response "GOOD" or "WRONG". This is my exercise: A1, B1, C1 = 7 {Values} A1:C1 = "DATA" E1=SUM(IF(CELL("WIDTH",A1)0,1,0)) {Visible Status} F1=SUM(IF(CELL("WIDTH",B1)0,1,0)) G1=SUM(IF(CELL("WIDTH",C1)0,1,0)) Hiding A, B, C results in E, F, G. When B is hidden E=1, F=0, G=1. The Visible Status is known. Now the cell values should only be added based on the Status. I1 = {SUM(IF(CELL("WIDTH",data)0,data,0))} Unluckily it does not work that way. Where am I wrong? Tomek |
={SUM(IF($E$1:$G$10,data,0))} gives the right response. The problem
is that for the each test (A:C) I should have a mirror array (E:G) what is very inconvenient with big multiworksheets database. TP, www.vba.blog.onet.pl |
I finally implemented the solution of Visible Status in Cells not in
Memory. It works fine! |
My pleasure indeed. See the following:
V_RNG = A1:X100 '$Value Range S_RNG = A200:X200 'Visible $Status A200 = CELL("width",A$1) AA1:AA100 'Simple Sum AA1 = SUM(A1:X1) AB1:AB100 'Visible Sum AB1={SUM(IF(S_RNG0,A1:X1,0))} AC1:AC100 'Sum Checking = Simple Sum Minus Visible Sum AC1=IF(ROUND(AA1-AB1,2)=0,"ok","BAD") AD1:AD100 Point Hidden Columns - Sums the number of Wrong Hidden Columns AD1={SUM(IF(S_RNG=0,IF($A1:$X1<0,COLUMN($A1:$X1), 0),0))} AD1:AD100 Point Hidden Columns - Counts the Wrong Hidden Columns AD1={SUM(IF(S_RNG=0,IF($A1:$X1<0,1,0),0))} It makes me feel much more comfortable now. __ Tomek Polak Enterprise Investors |
While searching Wrong Hidden Columns it is useful to toggle between
ReferenceStyles - I use small buttons with those macros. Sub Style_A1() Application.ReferenceStyle = xlA1 End Sub Sub Style_R1C1() Application.ReferenceStyle = xlR1C1 End Sub |
All times are GMT +1. The time now is 12:25 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com