View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Domenic Domenic is offline
external usenet poster
 
Posts: 150
Default How to set condition for frequency?

Let's assume that A2:A13 contains the data, try the following...

Dynamic Named Range:

Insert Name Define

Name: DynRange

Refers to:

='Sheet1'!$A$2:INDEX('Sheet1'!$A$2:$A$65536,MATCH( 9.99999999999999E+307,'
Sheet1'!$A$2:$A$65536))

Click Ok

Change the sheet reference accordingly.

Formulas:

B2:

=SUM(IF(FREQUENCY(DynRange,DynRange),1))

....confirmed with CONTROL+SHIFT+ENTER.

C2, copied down:

=IF(ROWS($C$2:C2)<=$B$2,INDEX(DynRange,SMALL(IF(Dy nRange<"",IF(MATCH(Dyn
Range,DynRange,0)=ROW(DynRange)-MIN(ROW(DynRange))+1,ROW(DynRange)-MIN(RO
W(DynRange))+1)),ROWS($C$2:C2))),"")

....confirmed with CONTROL+SHIFT+ENTER

D2, copied down:

=IF(C2<"",COUNTIF(DynRange,C2),"")

Hope this helps!

In article ,
Eric wrote:

Hi Domenic:
Thank you for your reply

There is a sorted list of numbers under column A, such as
1E-36,0.00056, 0.00056,1,1,1,3,3,99,99,8700000,9100000, which represent a
wide range of numbers, but each number represents a specific item, so I
cannot group any number between 0 and 100 into one group.

Therefore, there are 7 items under the list, and the first task is to list
out each number under column B without duplication, such as following 1E-36,
0.00056, 1, 3, 99, 8700000, 9100000 as a result.

And the next task is to measure the frequency of each number within the list
under column C, in this case, I can simply input {=frequency(A1:A12,B1:B7)}
for cell C1:C7, but one difficulty is that the length of list and the number
of items are not fixed, and I need to handle a dynamic list, therefore, I
cannot define the range A1:A12 and B1:B7 to measure frequency for the cell
C1:C7.

Would it be possible to measure frequency without define the range? such as
{=frequency(A:A,B:B)} for cell C:C. However, if I input {=Frequency(A:A,B:B)}
on column C then #N/A occurs because it seems to me that a blank cell is not
allowed.

Do you have any suggestions?
Would the above statement describes the issue more clear?
I look forward to your reply
Thank you for any suggestions
Eric