{"id":508332,"date":"2022-11-09T23:00:18","date_gmt":"2022-11-09T20:00:18","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-use-the-microsoft-excel-sort-function\/"},"modified":"2022-11-09T23:00:18","modified_gmt":"2022-11-09T20:00:18","slug":"how-to-use-the-microsoft-excel-sort-function","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-microsoft-excel-sort-function\/","title":{"rendered":"#How to Use the Microsoft Excel SORT Function"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a23a00275573\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a23a00275573\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-microsoft-excel-sort-function\/#%E2%80%9CHow_to_Use_the_Microsoft_Excel_SORT_Function%E2%80%9D\" >&#8220;How to Use the Microsoft Excel SORT Function&#8221;<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-microsoft-excel-sort-function\/#About_the_Excel_SORT_Formula\" >About the Excel SORT Formula<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-microsoft-excel-sort-function\/#Use_the_Excel_SORT_Function\" >Use the Excel SORT Function<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"%E2%80%9CHow_to_Use_the_Microsoft_Excel_SORT_Function%E2%80%9D\"><\/span>&#8220;How to Use the Microsoft Excel SORT Function&#8221;<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<div>\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage alignnone size-full wp-image-757715\" data-pagespeed-no-defer=\"\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/09\/microsoft_excel_hero_1200x675.jpg?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Microsoft Excel logo on a green background\" width=\"1200\" height=\"675\"\/><\/p>\n<p>To use the Excel SORT function, insert the following formula into a cell: SORT(range, index, order, by_column). The SORT function will sort your data without disturbing the original data set.<\/p>\n<p>While Microsoft Excel offers a built-in tool for sorting your data, you may prefer the flexibility of a function and formula. We\u2019ll show you how to use the Excel SORT function with helpful examples.<\/p>\n<p>The benefit of using the SORT function is that you can sort the data\u00a0in a different spot. If you want to manipulate the items without disturbing the original data set, you\u2019ll like the sorting function in Excel. However, if you prefer to sort the items in place, you should use the sort feature instead.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"About_the_Excel_SORT_Formula\"><\/span>About the Excel SORT Formula<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The syntax for the Excel sort formula is <code>SORT(range, index, order, by_column)<\/code> where only the first argument is required.<\/p>\n<p>If you\u2019re interested in using the optional arguments, here\u2019s how they work:<\/p>\n<ul>\n<li><b>Index<\/b><strong>:<\/strong> Enter a number to represent the row or column to sort by. Excel sorts by row 1 and column 1 by default.<\/li>\n<li><b>Order<\/b><strong>:<\/strong> Enter 1 for ascending order which is the default if omitted, or -1 for descending order.<\/li>\n<li><b>By_colum<\/b><strong>n:<\/strong> Enter False to sort by row, which is the default if omitted, or True to sort by column. This determines the direction of the sort.<\/li>\n<\/ul>\n<p>Now, let\u2019s look at examples using the SORT function in Excel.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Use_the_Excel_SORT_Function\"><\/span><a rel=\"nofollow noopener\" target=\"_blank\" name=\"autotoc_anchor_1\">Use the Excel SORT Function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You can use the SORT function for a range or array in Excel. Again, this does not <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.howtogeek.com\/793358\/list-and-sort-unique-values-and-text-in-microsoft-excel\/\">sort your items in place but in the spot where you enter the formula.<\/p>\n<p><strong>RELATED:<\/strong> <strong><em>How to List and Sort Unique Values and Text in Microsoft Excel<\/em><\/strong><\/p>\n<p>For a basic example, we\u2019ll simply sort the items in cells A2 through A6 using the defaults for the optional arguments:<\/p>\n<pre>=SORT(A2:A6)<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-846911\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/11\/BasicSort-ExcelSortFunction.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"SORT function for a single cell range\" width=\"434\" height=\"242\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>To sort a wider range, we\u2019ll include the cells B2 through B6 as well:<\/p>\n<pre>=SORT(A2:B6)<\/pre>\n<p>As you can see, the items remain coupled with their attributes.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-846910\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/11\/BasicSortExpandedRange-ExcelSortFunction.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"SORT function for a larger cell range\" width=\"454\" height=\"242\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Now we\u2019ll sort our range by the second column rather than the first. So, we enter 2 for the <code>index<\/code> argument:<\/p>\n<pre>=SORT(A2:B6,2)<\/pre>\n<p>You can see that our items are sorted in ascending order by the second column, with Green first and Yellow last.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-846912\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/11\/SortColumn2-ExcelSortFunction.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"SORT function using the second column\" width=\"452\" height=\"242\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Next, we\u2019ll use an example with the <code>order<\/code> argument and sort our array in descending order by including -1:<\/p>\n<pre>=SORT(A2:B6,,-1)<\/pre>\n<p>Notice that we leave the <code>index<\/code> argument empty because Excel uses the first row and column by default. As intended, we have Tangerine first and Apple last.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-846914\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/11\/SortDescending-ExcelSortFunction.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"SORT function for descending order\" width=\"463\" height=\"242\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>To sort in descending order by the second column, you\u2019d use this formula:<\/p>\n<pre>=SORT(A2:B6,2,-1)<\/pre>\n<p>Here, we include a 2 for the <code>index<\/code> argument and a -1 for the <code>order<\/code> argument. As expected, we see Yellow first and Green last.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-846915\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/11\/SortColumn2Descending-ExcelSortFunction.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"SORT function for descending order in the second column\" width=\"484\" height=\"242\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>For one final example, we\u2019ll include a value for each argument so you can see how they all work together. We\u2019ll enter a larger array of A2 through C6, a 3 to sort by the third column, a 1 for ascending order, and False for sorting by row direction.<\/p>\n<pre>=SORT(A2:C6,3,1,FALSE)<\/pre>\n<p>Our items are sorted by the Rating column and, like the other examples above, stay with their attributes.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-846916\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/11\/SortAllArguments-ExcelSortFunction.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"SORT function formula using all arguments\" width=\"627\" height=\"242\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>By using the Excel SORT formula, you can get a different view of your data based on the order you want to see your items. This makes it a handy data analysis tool.<\/p>\n<p>For more, check out how to sort by color or how to sort by date in Excel.<\/p>\n<\/div>\n<p><script>\n setTimeout(function(){\n  !function(f,b,e,v,n,t,s)\n  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n  n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n  n.queue=[];t=b.createElement(e);t.async=!0;\n  t.src=v;s=b.getElementsByTagName(e)[0];\n  s.parentNode.insertBefore(t,s) } (window, document,'script',\n  'https:\/\/connect.facebook.net\/en_US\/fbevents.js');\n   fbq('init', '335401813750447');\n   fbq('track', 'PageView');\n  },3000);\n<\/script><\/p>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.howtogeek.com\/846892\/how-to-use-the-microsoft-excel-sort-function\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;How to Use the Microsoft Excel SORT Function&#8221; To use the Excel SORT function, insert the following formula into a cell: SORT(range, index, order, by_column). The SORT function will sort your data without disturbing the original data set. While Microsoft Excel offers a built-in tool for sorting your data, you may prefer the flexibility of&#8230;<\/p>\n","protected":false},"author":1,"featured_media":508333,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/09\/microsoft_excel_hero_1200x675.jpg?height=200p&trim=2,2,2,2","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-508332","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/508332","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=508332"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/508332\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/508333"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=508332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=508332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=508332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}