#64 — Search for Top N Values And Last N Values

Judith-Excel-Sharing - Sep 25 - - Dev Community

Problem description & analysis:

Here below is a sales statistical table:

original source table
Task: Now we want to find out the products ranked in the top 10 by sales and their sales, and the last 10 products and their sales.

Solution:

Enter the following formulas in SPL XLL. The results are shown below:
Top 10:
=spl("=E(?1).sort(ProductSales:-1).to(10)",A1:C78)

result table of top 10 values
Last 10:
=spl("=E(?1).sort(ProductSales:-1).to(-10)",A1:C78)

result table of last 10 values


Please feel free to download esProc Desktop and boost your productivity today!⬇️

SPL download address: esProc Desktop FREE Download

Plugin Installation Method: SPL XLL Installation and Configuration

References to other rich Excel operation cases: Desktop and Excel Data Processing Cases

YouTube FREE courses: SPL Programming

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .