{"id":419,"date":"2025-07-15T13:34:46","date_gmt":"2025-07-15T13:34:46","guid":{"rendered":"https:\/\/functiontranslator.com\/2021\/02\/12\/sortby\/"},"modified":"2021-02-13T11:36:24","modified_gmt":"2021-02-13T11:36:24","slug":"sortby","status":"publish","type":"post","link":"https:\/\/functiontranslator.com\/en\/sortby\/","title":{"rendered":"SORTBY"},"content":{"rendered":"<p>Welcome to our guide on using the SORTBY function in Microsoft Excel and Google Sheets.<\/p>\n<h2>Introduction<\/h2>\n<p>The SORTBY function enables sorting a range or array according to the values in a corresponding range or array. This is particularly useful for organizing data according to criteria specified in a different range.<\/p>\n<h2>Syntax<\/h2>\n<p>The syntax for the SORTBY function is consistent across Microsoft Excel and Google Sheets:<\/p>\n<pre><code>=SORTBY(range_to_sort, range_to_sort_by, [sort_order1], [range_to_sort_by2], [sort_order2], ...)<\/code><\/pre>\n<ul>\n<li><code>range_to_sort<\/code>: The range of cells you wish to organize.<\/li>\n<li><code>range_to_sort_by<\/code>: The range of cells that determines the order of the <code>range_to_sort<\/code>.<\/li>\n<li><code>sort_order<\/code>: Optional. Use 1 for ascending order and -1 for descending order.<\/li>\n<\/ul>\n<h2>Examples<\/h2>\n<h2>Sorting Student Scores in Excel\/Sheets<\/h2>\n<p>Consider a dataset of student scores as shown below:<\/p>\n<table border=\"1\">\n<tr>\n<th>Student<\/th>\n<th>Score<\/th>\n<\/tr>\n<tr>\n<td>Tom<\/td>\n<td>85<\/td>\n<\/tr>\n<tr>\n<td>Amy<\/td>\n<td>92<\/td>\n<\/tr>\n<tr>\n<td>John<\/td>\n<td>78<\/td>\n<\/tr>\n<tr>\n<td>Lisa<\/td>\n<td>88<\/td>\n<\/tr>\n<\/table>\n<p>To sort the students by their scores in ascending order, use the SORTBY function:<\/p>\n<pre><code>=SORTBY(A2:B5, B2:B5, 1)<\/code><\/pre>\n<p>This will return the students sorted by their scores:<\/p>\n<table border=\"1\">\n<tr>\n<th>Student<\/th>\n<th>Score<\/th>\n<\/tr>\n<tr>\n<td>John<\/td>\n<td>78<\/td>\n<\/tr>\n<tr>\n<td>Tom<\/td>\n<td>85<\/td>\n<\/tr>\n<tr>\n<td>Lisa<\/td>\n<td>88<\/td>\n<\/tr>\n<tr>\n<td>Amy<\/td>\n<td>92<\/td>\n<\/tr>\n<\/table>\n<h2>Sorting Data in Multiple Columns<\/h2>\n<p>For scenarios requiring sorting by multiple criteria, such as sorting by both age and name, you could apply SORTBY as follows:<\/p>\n<pre><code>=SORTBY(A2:B5, B2:B5, 1, A2:A5, -1)<\/code><\/pre>\n<h2>Conclusion<\/h2>\n<p>The SORTBY function offers a robust mechanism for sorting data in Excel and Google Sheets based on secondary values. It is versatile in accommodating various sorting requirements and methodologies. Understanding and utilizing SORTBY facilitates effective data management and analysis in large data sets.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sorts the contents of a range or array based on the values in a corresponding range or array<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[200],"tags":[],"class_list":["post-419","post","type-post","status-publish","format-standard","hentry","category-lookup-and-reference"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Excel SORTBY Function \u2013 How It Works, Formula Examples and Syntax<\/title>\n<meta name=\"description\" content=\"Learn what the Excel SORTBY function does. Clear syntax explanation and useful formula examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/functiontranslator.com\/en\/sortby\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Excel SORTBY Function \u2013 How It Works, Formula Examples and Syntax\" \/>\n<meta property=\"og:description\" content=\"Learn what the Excel SORTBY function does. Clear syntax explanation and useful formula examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/functiontranslator.com\/en\/sortby\/\" \/>\n<meta property=\"og:site_name\" content=\"Function Translator\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-15T13:34:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-13T11:36:24+00:00\" \/>\n<meta name=\"author\" content=\"glavadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Excel SORTBY Function \u2013 How It Works, Formula Examples and Syntax\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"glavadmin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/functiontranslator.com\/en\/sortby\/\",\"url\":\"https:\/\/functiontranslator.com\/en\/sortby\/\",\"name\":\"Excel SORTBY Function \u2013 How It Works, Formula Examples and Syntax\",\"isPartOf\":{\"@id\":\"https:\/\/functiontranslator.com\/no\/#website\"},\"datePublished\":\"2025-07-15T13:34:46+00:00\",\"dateModified\":\"2021-02-13T11:36:24+00:00\",\"author\":{\"@id\":\"https:\/\/functiontranslator.com\/no\/#\/schema\/person\/87663eece497ca58643166ecb09f1389\"},\"description\":\"Learn what the Excel SORTBY function does. Clear syntax explanation and useful formula examples.\",\"breadcrumb\":{\"@id\":\"https:\/\/functiontranslator.com\/en\/sortby\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/functiontranslator.com\/en\/sortby\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/functiontranslator.com\/en\/sortby\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Function Excel\",\"item\":\"https:\/\/functiontranslator.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Lookup and reference\",\"item\":\"https:\/\/functiontranslator.com\/en\/lookup-and-reference\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SORTBY\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/functiontranslator.com\/no\/#website\",\"url\":\"https:\/\/functiontranslator.com\/no\/\",\"name\":\"Function Translator\",\"description\":\"Excel function translator\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/functiontranslator.com\/no\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/functiontranslator.com\/no\/#\/schema\/person\/87663eece497ca58643166ecb09f1389\",\"name\":\"glavadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/functiontranslator.com\/no\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/03ccd9347c5339db75deede5a8c5b2bf1d40e0bce26a5251fcaac6331d381db8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/03ccd9347c5339db75deede5a8c5b2bf1d40e0bce26a5251fcaac6331d381db8?s=96&d=mm&r=g\",\"caption\":\"glavadmin\"},\"sameAs\":[\"https:\/\/functiontranslator.com\"],\"url\":\"https:\/\/functiontranslator.com\/en\/author\/glavadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Excel SORTBY Function \u2013 How It Works, Formula Examples and Syntax","description":"Learn what the Excel SORTBY function does. Clear syntax explanation and useful formula examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/functiontranslator.com\/en\/sortby\/","og_locale":"en_US","og_type":"article","og_title":"Excel SORTBY Function \u2013 How It Works, Formula Examples and Syntax","og_description":"Learn what the Excel SORTBY function does. Clear syntax explanation and useful formula examples.","og_url":"https:\/\/functiontranslator.com\/en\/sortby\/","og_site_name":"Function Translator","article_published_time":"2025-07-15T13:34:46+00:00","article_modified_time":"2021-02-13T11:36:24+00:00","author":"glavadmin","twitter_card":"summary_large_image","twitter_title":"Excel SORTBY Function \u2013 How It Works, Formula Examples and Syntax","twitter_misc":{"Written by":"glavadmin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/functiontranslator.com\/en\/sortby\/","url":"https:\/\/functiontranslator.com\/en\/sortby\/","name":"Excel SORTBY Function \u2013 How It Works, Formula Examples and Syntax","isPartOf":{"@id":"https:\/\/functiontranslator.com\/no\/#website"},"datePublished":"2025-07-15T13:34:46+00:00","dateModified":"2021-02-13T11:36:24+00:00","author":{"@id":"https:\/\/functiontranslator.com\/no\/#\/schema\/person\/87663eece497ca58643166ecb09f1389"},"description":"Learn what the Excel SORTBY function does. Clear syntax explanation and useful formula examples.","breadcrumb":{"@id":"https:\/\/functiontranslator.com\/en\/sortby\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/functiontranslator.com\/en\/sortby\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/functiontranslator.com\/en\/sortby\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Function Excel","item":"https:\/\/functiontranslator.com\/en\/"},{"@type":"ListItem","position":2,"name":"Lookup and reference","item":"https:\/\/functiontranslator.com\/en\/lookup-and-reference\/"},{"@type":"ListItem","position":3,"name":"SORTBY"}]},{"@type":"WebSite","@id":"https:\/\/functiontranslator.com\/no\/#website","url":"https:\/\/functiontranslator.com\/no\/","name":"Function Translator","description":"Excel function translator","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/functiontranslator.com\/no\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/functiontranslator.com\/no\/#\/schema\/person\/87663eece497ca58643166ecb09f1389","name":"glavadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/functiontranslator.com\/no\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/03ccd9347c5339db75deede5a8c5b2bf1d40e0bce26a5251fcaac6331d381db8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/03ccd9347c5339db75deede5a8c5b2bf1d40e0bce26a5251fcaac6331d381db8?s=96&d=mm&r=g","caption":"glavadmin"},"sameAs":["https:\/\/functiontranslator.com"],"url":"https:\/\/functiontranslator.com\/en\/author\/glavadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/posts\/419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/comments?post=419"}],"version-history":[{"count":3,"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/posts\/419\/revisions"}],"predecessor-version":[{"id":3310,"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/posts\/419\/revisions\/3310"}],"wp:attachment":[{"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/media?parent=419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/categories?post=419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/tags?post=419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}