Tools
Pricing
Log in
Try for free

SORTBY Excel Formula

Convert your text instructions into Excel formulas - powered by AI.

Syntax
=SORTBY(array, by_array1, [sort_order1], [by_array2], [sort_order2], ...)
Example Use Case
You have a table where Column A contains product names and Column B contains their corresponding sales figures. You can use the SORTBY function to sort the products based on their sales figures in descending order. This allows for quick identification of the top-selling products, enabling better inventory management and targeted marketing strategies without the need for complex sorting algorithms.
Generate
Explain
formula based on
Generate with AI

What is a SORTBY Formula in Excel?

The SORTBY function in Excel is a powerful tool that allows you to sort a range or array based on the values in one or more other ranges or arrays. It enables you to organize your data in a meaningful way, making it easier to analyze and interpret.

In simpler terms, the SORTBY function helps you rearrange your data based on specific criteria, allowing for a more structured view of your information.

A Practical Example

Imagine you are managing a student grades report, and you have the following data in an Excel spreadsheet:

Student Grades Table:

Student Name Grade Age
Alice 85 20
Bob 90 22
Charlie 78 21
David 92 23
Eve 88 20

You want to sort the students by their grades in descending order.

SORTBY Formula

To sort the student names based on their grades, you would use the SORTBY formula as follows:

EXCEL icon EXCEL
=SORTBY(A2:A6, B2:B6, -1)

Breakdown of the Formula:

  • A2:A6: This is the range of values that you want to sort (student names).
  • B2:B6: This is the range that contains the values used for sorting (grades).
  • -1: This indicates that the sorting should be done in descending order (highest to lowest).

Result of the Formula

When you apply the formula, it sorts the student names based on their grades in descending order. The output would be:

Sorted Student Names
David
Bob
Eve
Alice
Charlie

Here, the students are listed from the highest grade (David with 92) to the lowest (Charlie with 78).

Why Use SORTBY?

The SORTBY function is particularly useful when you need to organize your data based on specific criteria without manually sorting it. It allows you to quickly rearrange your datasets, making it easier to draw insights and make informed decisions.

Key Takeaways:

  • SORTBY: Sorts a range or array based on the values in one or more other ranges or arrays.
  • Efficient Data Organization: Helps you quickly arrange data without complex sorting methods.
  • Common Use Cases: Ideal for organizing reports, analyzing scores, and any scenario where data needs to be sorted based on specific criteria.

Understanding how to use the SORTBY function can significantly enhance your data management capabilities in Excel, enabling you to present your datasets in a clear and structured manner.

Happy sorting!

Check out all of the Excel formulas
=ACCRINT(issue, first_interest, settlement, maturity, rate, par, frequency, [basis])
The ACCRINT formula calculates accrued interest for bonds by inputting parameters like issue date, rate, and maturity for precise results.
=ACCRINTM(issue, first_interest, settlement, maturity, rate, par, frequency, [basis])
The ACCRINTM function calculates accrued interest for bonds from issue date to maturity, providing a quick interest assessment.
=ACOSH(number)
The ACOSH function calculates the inverse hyperbolic cosine of a number, useful for advanced mathematical and statistical analysis.
=ACOS(number)
The ACOS function calculates the arccosine of a number, returning the result in radians for accurate mathematical computations.
=ACOTH(number)
The ACOTH function calculates the inverse hyperbolic cotangent of a number, useful for advanced mathematical analysis in Excel.
=ACOT(number)
The ACOT function calculates the arccotangent of a number, returning the angle in radians for accurate mathematical computations.
=ADDRESS(row_num, column_num, [abs_num], [a1], [sheet])
The ADDRESS function generates a cell reference based on specified row and column numbers, allowing dynamic referencing in formulas.
=AGGREGATE(function_num, options, array, [k], [sigma])
The AGGREGATE function performs advanced calculations while allowing you to ignore errors and customize results for better data analysis.
=AMORDEGRC(cost, date_purchased, first_period, salvage, life, [method], [month])
The AMORDEGRC function calculates depreciation for an asset based on its cost, purchase date, salvage value, and lifespan.
=AMORLINC(cost, date_purchased, first_period, salvage, life, [method], [month])
The AMORLINC function calculates an asset's depreciation over time, factoring in cost, purchase date, salvage value, and lifespan.
=AND(logical1, [logical2], ...)
The AND function evaluates multiple conditions in Excel, returning TRUE only if all specified conditions are met for logical tests.
=ARABIC(text)
The ARABIC function converts Roman numeral text into Arabic numbers, streamlining numerical calculations in Excel.
=AREAS(reference)
The AREAS function counts the number of distinct areas in a specified range, aiding in efficient data analysis and management.
=ARRAYTOTEXT(array, [format])
The ARRAYTOTEXT formula converts arrays into text format in Excel, enabling customized formatting for improved data presentation.
=ASINH(number)
The ASINH function calculates the inverse hyperbolic sine of a number, useful for advanced mathematical analysis in Excel.
=ASIN(number)
The ASIN function calculates the arcsine of a number, returning the angle in radians for inputs between -1 and 1.
=ATAN2(x_num, y_num)
The ATAN2 function calculates the arctangent of the quotient of two numbers, returning the angle in radians.
=ATANH(number)
The ATANH function calculates the inverse hyperbolic tangent of a number for precise mathematical analysis in Excel.
=ATAN(number)
The ATAN function calculates the arctangent of a number, returning the angle in radians for trigonometric calculations in Excel.
=AVEDEV(number1, [number2], ...)
The AVEDEV function calculates the average of absolute deviations from the mean, helping assess data variability and dispersion in a dataset.
=AVERAGEA(value1, [value2], ...)
The AVERAGEA function calculates the average of a range, treating text as 0 and logical values as 1, including all data types in the range.
=AVERAGEIF(range, criteria, [average_range])
The AVERAGEIF function calculates the average of a range based on specified criteria, enhancing data analysis efficiency in Excel.
=AVERAGEIFS(average_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
The AVERAGEIFS function calculates the average of a dataset based on specified criteria, allowing for precise data analysis in Excel.
=AVERAGE(number1, [number2], ...)
The AVERAGE function calculates the mean of a range of numbers, providing insights for accurate data analysis in Excel.
=BASE(number, radix, [min_length])
The BASE function converts numbers to specified bases, allowing customization of radix and minimum length for flexible data representation.
=BIN2DEC(number)
The BIN2DEC function converts binary numbers to decimal format, facilitating easier data analysis and calculations in Excel.
=BIN2HEX(number, [places])
The BIN2HEX function converts binary numbers to hexadecimal format, aiding in data analysis and format management in Excel.
=BIN2OCT(number, [places])
The BIN2OCT function converts binary numbers to octal format, allowing for customizable output length with the optional places argument.
=BINOM.DIST(number_s, trials, probability_s, cumulative)
The BINOM.DIST formula calculates the probability of a specific number of successes in a binomial distribution based on trials and success rate.
=BINOMDIST(number_s, trials, probability_s, cumulative)
The BINOMDIST formula calculates the probability of achieving a specific number of successes in a binomial distribution scenario.
=BITAND(number1, number2)
The BITAND function performs a bitwise AND operation between two numbers, returning a number that represents the common bits set to 1.
=BITLSHIFT(number, shift_amount)
The BITLSHIFT formula shifts bits to the left, multiplying the number by 2 for each shift, useful for advanced data manipulation.
=BITOR(number1, number2)
The BITOR function performs a bitwise OR operation between two numbers, useful for efficient data manipulation in Excel.
=BITRSHIFT(number, shift_amount)
The BITRSHIFT function shifts bits of a number to the right, effectively dividing it by powers of two for data manipulation.
=BITXOR(number1, number2)
The BITXOR function performs a bitwise XOR operation between two numbers, useful for efficient data analysis in Excel.
=BYCOL(array, lambda)
The =BYCOL function applies a lambda function to each column in a range, streamlining data analysis and manipulation in Excel.
=BYROW(array, lambda)
The =BYROW(array, lambda) formula applies a specified function to each row in an array, streamlining data analysis in Excel.
=CEILING.MATH(number, [significance], [mode])
The CEILING.MATH function rounds numbers up to the nearest specified significance, helping to standardize values in calculations.
=CEILING(number, significance)
The CEILING function rounds numbers up to the nearest specified significance, ensuring precise calculations in Excel.
=CEILING.PRECISE(number, significance)
The CEILING.PRECISE function rounds numbers up to the nearest specified significance, ensuring accurate and precise calculations in Excel.
=CELL(info_type, [reference])
The =CELL(info_type, [reference]) formula retrieves details about a cell's formatting, location, or contents in Excel.
=CHAR(number)
The CHAR function converts numeric ASCII codes into their corresponding characters, simplifying text manipulation in Excel.
=CHOOSECOLS(array, column_num1, [column_num2], ...)
The CHOOSECOLS function selects specific columns from an array, simplifying data analysis by focusing on relevant information.
=CHOOSE(index_num, value1, [value2], ...)
The CHOOSE function selects a value from a list based on a specified index number, streamlining data retrieval and management in Excel.
=CHOOSEROWS(array, row_num)
The CHOOSEROWS function selects specific rows from an array, enhancing data analysis by allowing targeted data retrieval.
=CLEAN(text)
The CLEAN function in Excel removes non-printable characters from text, ensuring your data is clean and easy to read in spreadsheets.
=CODE(text)
The =CODE(text) formula returns the numeric ASCII code of the first character in a text string, aiding in data analysis and manipulation.
=COLUMN([reference])
The =COLUMN([reference]) formula returns the column number of a specified cell or range, aiding in data analysis and referencing.
=COLUMNS(array)
The COLUMNS function counts the number of columns in a specified array or range, providing a quick way to assess data structure.
=COMBINA(n, k)
The COMBINA function calculates the number of combinations of n items taken k at a time, useful for statistical analysis.
=COMBIN(number, number_chosen)
The COMBIN function calculates the number of combinations for a given number of items, helping you choose subsets from a larger set.
=COMPLEX(real_num, i_num, [suffix])
The COMPLEX function creates complex numbers from real and imaginary parts, aiding in advanced data analysis in Excel.
=CONCATENATE(text1, [text2], ...)
The CONCATENATE function combines multiple text strings into one, improving data organization and presentation in Excel.
=CONCAT(text1, [text2], ...)
The CONCAT function combines multiple text strings into one, improving data organization and presentation in Excel.
=CONVERT(number, from_unit, to_unit)
The CONVERT function is used to change a value from one unit of measurement to another in Excel, simplifying unit conversions.
=COSH(number)
The COSH function calculates the hyperbolic cosine of a number, useful in advanced math and engineering contexts.
=COS(number)
The COS function calculates the cosine of an angle in radians, aiding in precise trigonometric analysis within Excel.
=COTH(x)
The COTH function calculates the hyperbolic cotangent of a number, useful for advanced mathematical analysis and data modeling.
=COT(number)
The COT keyword calculates the cotangent of an angle in radians for precise trigonometric analysis using the =COT(number) formula in Excel.
=COUNTA(value1, [value2], ...)
The COUNTA function counts non-empty cells in a specified range, aiding in effective data analysis and summarization.
=COUNTBLANK(range)
The COUNTBLANK function counts the number of empty cells in a specified range, helping identify gaps in data entry.
=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...)
The COUNTIF function counts the number of cells in a range that meet a specified condition or criteria.
=COUNT(value1, [value2], ...)
The COUNT function in Excel counts numeric entries in a specified range, helping to analyze data effectively.
=COUPDAYBS(settlement, maturity, frequency, [basis])
The COUPDAYBS function calculates the number of days from the settlement date to the next coupon payment date for a bond.
=COUPDAYSNC(settlement, maturity, frequency, [basis])
The COUPDAYSNC function calculates the number of days from the settlement date to the next coupon payment date for a security.
=COUPDAYS(settlement, maturity, frequency, [basis])
The COUPDAYS function calculates the number of coupon payment days between settlement and maturity dates for a security.
=COUPNCD(settlement, maturity, frequency, [basis])
The COUPNCD function calculates the next coupon payment date for bonds, based on the settlement and maturity dates provided.
=COUPNUM(settlement, maturity, frequency, [basis])
The COUPNUM function calculates the total number of coupon payments between the settlement date and maturity date of a bond.
=COUPPCD(settlement, maturity, coupon, frequency, [basis])
The COUPPCD function calculates the next coupon payment date for bonds, simplifying bond analysis by providing essential payment timing information.
=CSCH(number)
The CSCH function calculates the hyperbolic cosecant of a number for advanced mathematical analysis in Excel.
=CSC(number)
The CSC function calculates the cosecant of an angle in radians, useful for trigonometric calculations in Excel.
=CUMIPMT(rate, nper, pv, start_period, end_period, type)
The CUMIPMT function calculates cumulative interest payments over a specified period, using rate, periods, present value, and payment timing.
=CUMPRINC(rate, nper, pv, start_period, end_period, type)
The CUMPRINC formula calculates total principal payments over a period, using interest rate, periods, present value, and payment timing.
=DATEDIF(start_date, end_date, unit)
The DATEDIF formula calculates the difference between two dates by specifying the start date, end date, and desired unit for accurate results.
=DATEVALUE(date_text)
The DATEVALUE function converts date text into a serial number for easier date calculations and analysis in Excel.
=DATE(year, month, day)
The DATE function creates a date in Excel by specifying the year, month, and day for accurate formatting and calculations.
=DAVERAGE(database, field, criteria)
The DAVERAGE function calculates the average of a specified field in a database that meets defined criteria.
=DAYS360(start_date, end_date, [method])
The DAYS360 function calculates the number of days between two dates based on a 360-day year, with options for different day count conventions.
=DAYS(end_date, start_date)
The DAYS function calculates the number of days between two dates, providing a simple way to find date differences in Excel.
=DAY(serial_number)
The DAY function extracts the day from a date in Excel, helping simplify date analysis and improve data management.
=DB(database, field, criteria)
The DB function calculates depreciation for an asset based on its database, field, and specified criteria for precise financial evaluation.
=DCOUNTA(database, field, criteria)
The DCOUNTA function counts non-empty entries in a database that meet specified criteria, helping analyze data effectively.
=DCOUNT(database, field, criteria)
The DCOUNT function counts the number of records in a database that meet specified criteria, aiding in precise data analysis.
=DDB(cost, salvage, life, period, [factor])
The DDB function calculates asset depreciation using the double declining balance method, factoring in cost, salvage value, life, and period.
=DEC2BIN(number, [places])
The DEC2BIN function converts decimal numbers to binary format, allowing customization of output length with the optional places argument.
=DEC2HEX(number, [places])
The DEC2HEX function converts decimal numbers to hexadecimal format in Excel, with an option for padding digits.
=DEC2OCT(number, [places])
The DEC2OCT function converts decimal numbers to octal format in Excel, with an option to specify the number of digit places.
=DECIMAL(text, radix)
The DECIMAL function converts numbers from a specified base (radix) to decimal format, allowing for easy numerical analysis in Excel.
=DEGREES(radians)
The DEGREES function converts radians to degrees in Excel, simplifying angle calculations with the formula =DEGREES(radians).
=DELTA(number1, [number2])
The DELTA function compares two numbers, returning 1 if they are equal and 0 if they are not, useful for logical tests in Excel.
=DEVSQ(number1, [number2], ...)
The DEVSQ function calculates the sum of squared deviations from the mean, aiding in statistical analysis and providing data insights.
=DGET(database, field, criteria)
The DGET function retrieves a single value from a database that meets specified criteria, aiding in targeted data analysis.
=DISC(settlement, maturity, rate, yield, redemption, frequency, [basis])
The DISC function calculates the discount on a security based on settlement, maturity, rate, yield, redemption, frequency, and basis.
=DMAX(database, field, criteria)
The DMAX function returns the highest value from a specified field in a database that meets given criteria.
=DMIN(database, field, criteria)
The DMIN function finds the minimum value in a database that meets specified criteria, aiding in efficient data analysis.
=DOLLARDE(fraction, fraction_denom)
The DOLLARDE function converts fractional dollar amounts to decimal, simplifying financial calculations in Excel.
=DOLLARFR(decimal, fraction)
The DOLLARFR function converts decimal numbers into fractional dollar amounts for accurate financial calculations.
=DOLLAR(number, [decimals])
The DOLLAR function formats numbers as currency, allowing customization of decimal places for precise financial reporting.
=DPRODUCT(database, field, criteria)
The DPRODUCT function multiplies values in a specified field of a database that meet defined criteria.
=DROP(array, rows, [columns])
The DROP function removes designated rows and columns from an array, simplifying data for analysis and enhancing clarity in Excel.
Try our other free AI data tools
//e1b5c549a6dd5273e224cd87b24dd3fb.cdn.bubble.io/f1712248048835x171910885545995420/data%20analyser.svg_icon
AI Data Analysis Chat
Chat with your data to generate visualizations, spreadsheets, insights, advanced analysis & more.
//e1b5c549a6dd5273e224cd87b24dd3fb.cdn.bubble.io/f1711640762344x820626742105414500/excel-formula-generator_icon.svg_icon
AI Excel Formula Generator
Convert your text instructions into formulas or input a formula to have it explained with our Excel AI Formula Generator.
//e1b5c549a6dd5273e224cd87b24dd3fb.cdn.bubble.io/f1724422435477x384387332830927740/sentiment-analysis-tool.svg_icon
Sentiment Analysis Tool
Upload a file or list of text to generate the sentiment - positive, negative or neutral.