Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default 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

  #3   Report Post  
 
Posts: n/a
Default

It seems that Count doesn't take into account whether a cell is hidden
or not. It counts it anyway...

  #4   Report Post  
Roger Govier
 
Posts: n/a
Default

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...



  #5   Report Post  
Richard Buttrey
 
Posts: n/a
Default

On 13 Oct 2005 02:44:06 -0700, 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


You could try playing around with the cell width value of columns
since a hidden column will return zero.

For example:
E1:G3 contains your data
E F G
1 1 10 20
2 2 11 30
3 3 12 40

A1:A3 contains the column letters of your data, i.e. A1=E, A2=F, A3=G

Now put the following in B1 and copy down to B3

=IF(CELL("width",INDIRECT(A1&"1"))=0,"Hidden","Vis ible")

Now put the following in C1 and copy down to C3

=SUM(INDIRECT(A1&"1"):INDIRECT(A1&"3"))

Column B will tell you whether your data columns are hidden or not,
and column C will tell you the aggregate value of the columns. You
could modify C1 etc formulae to only show a total if column B1 etc is
"Hidden".

Hide say column F with Format Column Width to zero, and press F9 to
recalculate to test. For some reason you have to do this since the
formulae don't appear to re-act when you first set widths to zero.

The above won't alert you to a hidden column which contains positive
and negative data that aggregates to zero. You might want to modify
things with array formua formulae to test for that condition.

HTH


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________


  #6   Report Post  
 
Posts: n/a
Default

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

  #7   Report Post  
 
Posts: n/a
Default

={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

  #8   Report Post  
 
Posts: n/a
Default

I finally implemented the solution of Visible Status in Cells not in
Memory. It works fine!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subtotal function with Filtered Data RonB Excel Discussion (Misc queries) 3 August 12th 05 10:04 PM
undefined function error when creating xls pivot from mdb qry andrew Excel Worksheet Functions 0 July 29th 05 07:26 PM
clock Wildman Excel Worksheet Functions 2 April 26th 05 10:31 AM
Trim function doesn't clean out ASCII Code 160 (Space) Ronald Dodge Excel Worksheet Functions 6 January 27th 05 03:48 AM
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. Robert AS Excel Worksheet Functions 4 December 2nd 04 10:49 AM


All times are GMT +1. The time now is 03:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"