Thanks:  0
Likes:  0

1. I have a list of 50 or so products along with the units sold in the adjacent column. I would like to list the top 10 products along with the units sold at the bottom of this list. Can anyone help me with the code for this?

thanks

Matt

2. Have you tried using the RANK worksheet function and then extract the top 10 or sort on the returned ranks?

[ This Message was edited by: Mark W. on 2002-03-04 07:12 ]

3. On 2002-03-04 05:13, Matt wrote:
I have a list of 50 or so products along with the units sold in the adjacent column. I would like to list the top 10 products along with the units sold at the bottom of this list. Can anyone help me with the code for this?

thanks

Matt
Consider the following small sample in A1:B4.

{"p1",20;"p2",20;"p3",30;"p4",15}

In C1 enter:

=RANK(B1,\$B\$1:\$B\$4,1)+COUNTIF(\$B\$1:B1,B1)-1

Copy down this as far as needed.

In A53 enter:

=INDEX(\$A\$1:\$A\$4,MATCH(LARGE(\$C\$1:\$C\$4,ROW()-52),\$C\$1:\$C\$4,0))

Notice 52 in the formula, which is the number of rows before the cell of this formula!

In B53 enter:

=INDEX(\$B\$1:\$B\$4,MATCH(LARGE(\$C\$1:\$C\$4,ROW()-52),\$C\$1:\$C\$4,0))

Select A53:B53 and copy down the last two formulas as far as needed: In your case, 10 rows down.

That's great, thanks for your help!

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•