Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Recalculation using filter

I'm caculating the number of unique values in a column,
but when the user uses a filter, the number does not
recalculate.

How do I make it recalculate the number of unique values?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Recalculation using filter

you'll need to work with the

=SUBTOTAL() instead of SUM()

see Excel Help for arguments.


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Jeff" wrote:

I'm caculating the number of unique values in a column,
but when the user uses a filter, the number does not
recalculate.

How do I make it recalculate the number of unique values?

Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Recalculation using filter

Thanks for the suggestion, but I need to caluculate unique
values, and I don't know how to do that with Subtotal.
Here's my current caculation:

Range("J" & NumRows + 2).Formula =
"=SUM(IF(FREQUENCY(A7:A" & NumRows & ",A7:A" & NumRows & ")
0,1))"



Any other thoughts?

Thanks

-----Original Message-----
you'll need to work with the

=SUBTOTAL() instead of SUM()

see Excel Help for arguments.


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Jeff" wrote:

I'm caculating the number of unique values in a column,
but when the user uses a filter, the number does not
recalculate.

How do I make it recalculate the number of unique

values?

Thanks!


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Recalculation using filter

hmm..

I see you problem :(
subtotal wont work in combination with frequency..

afaik you'd need an UDF (vba function) to determine
row visibility as I dont think it can be done with a normal
worksheetfunction or even an old xl5 macro command



Function RowVisible(ref As Range)
Dim r As Long
With ref.EntireRow.Rows
ReDim v(1 To .Count) As Boolean
For r = 1 To .Count
v(r) = Not .Item(r).Hidden
Next
End With
RowVisible = v
End Function

Then

=Sum(n(frequency(a7:a12*n(rowvisible(a7:a12)),a7:a 12)0))


function should be available to the sheet
(which may be a problem...)

N() function converts a boolean to a value

it might work... it's just too complex.... sorry :(


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


wrote:

Thanks for the suggestion, but I need to caluculate unique
values, and I don't know how to do that with Subtotal.
Here's my current caculation:

Range("J" & NumRows + 2).Formula =
"=SUM(IF(FREQUENCY(A7:A" & NumRows & ",A7:A" & NumRows & ")
0,1))"



Any other thoughts?

Thanks

-----Original Message-----
you'll need to work with the

=SUBTOTAL() instead of SUM()

see Excel Help for arguments.


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Jeff" wrote:

I'm caculating the number of unique values in a column, but when

the
user uses a filter, the number does not recalculate.

How do I make it recalculate the number of unique values?

Thanks!


.


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
Recalculation Lpoffe Excel Worksheet Functions 0 October 2nd 09 06:06 PM
Recalculation A Bauer Excel Discussion (Misc queries) 1 March 7th 07 10:01 PM
Recalculation R Ormerod Excel Discussion (Misc queries) 5 March 19th 06 08:54 AM
Too much recalculation Diane Meade[_2_] Excel Programming 2 May 26th 04 07:19 PM
Recalculation Anna[_6_] Excel Programming 1 May 24th 04 11:15 PM


All times are GMT +1. The time now is 07:21 PM.

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

About Us

"It's about Microsoft Excel"