SORTN Google Sheets Formula
Generate Google Sheets SORTN Formulas in seconds
Interactive Google Sheets Formula Generator
Formula Generator
Create complex Google Sheets formulas with natural language. Simply describe what you want to calculate.
Upgrade to Sheet Alchemy Pro
Get advanced formulas, batch processing, and priority support
Input
Result
Your formula will be displayed here:
Your formula will appear here
Describe what you want to calculate and click Generate
Pro Features Available
Sheet Alchemy Pro includes additional advanced features to enhance your formula generation.
Advanced Formulas
Complex array formulas and dynamic ranges
Batch Processing
Generate multiple formulas at once
Unlimited History
Save and organize all your formulas
SORTN Formula Syntax
Example Use Case
Sorts a range and returns the top N rows in Google Sheets.
Understanding the SORTN Function in Google Sheets
The SORTN function sorts a range and returns only the top N rows, with options for tie handling and sort order.
Why Use SORTN in Google Sheets?
SORTN is perfect for ranking tasks, like finding the top performers or lowest values.
Example with Sample Data
| Data | Formula | Result |
|---|---|---|
| A1:B5 = {5, "A"; 15, "B"; 8, "C"; 20, "D"; 12, "E"} | =SORTN(A1:B5, 3, 0, 1, TRUE) | {5, "A"; 8, "C"; 12, "E"} |
| A1:B3 = {1, 10; 3, 30; 2, 20} | =SORTN(A1:B3, 2, 0, 2, FALSE) | {3, 30; 2, 20} |
| A1:B2 = {10, "X"; 5, "Y"} | =SORTN(A1:B2, 1, 0, 1, TRUE) | {5, "Y"} |
The table shows how SORTN returns the top N rows (0=keep ties, TRUE=ascending).
Explore More Google Sheets Formulas
CODE
Returns the numeric ASCII code of the first character in a text string in Google Sheets.
Learn moreCOUNTA
Counts non-empty cells in a range in Google Sheets, including text and numbers, useful for tracking filled entries.
Learn moreISERR
Checks if a value is an error other than #N/A in Google Sheets, returning TRUE or FALSE.
Learn moreCOUNT
Counts the number of cells with numeric values in a range in Google Sheets, useful for tallying numbers.
Learn moreCOMBIN
Calculating the number of ways to choose a given number of items from a set, without repetition, useful for combinatorics and statistical calculations in Google Sheets.
Learn moreISNUMBER
Checks if a value is a number in Google Sheets, returning TRUE or FALSE.
Learn moreSEC
Calculates the secant of an angle (in radians) in Google Sheets, used in trigonometric applications.
Learn moreDCOUNT
Counts numeric values in a column of a database range based on criteria in Google Sheets.
Learn moreTransform Your Spreadsheet Experience
Join thousands of users revolutionizing their data workflows. Get access to premium tools and expert knowledge.
