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

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

Problem description & analysis:

Here below is a sales statistical table:

r/esProc_Desktop - Search for Top N Values And Last N Values

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)

r/esProc_Desktop - Search for Top N Values And Last N Values

Last 10:

=spl("=E(?1).sort(ProductSales:-1).to(-10)",A1:C78)

r/esProc_Desktop - Search for Top N Values And Last N 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