Ravindra BagaleCourses & study guides Track your progress

Excel SORT Function

Chala mitrano — today SORT. Spill a sorted copy — leave the source untouched.

Fictional sample data for learning. Ordered boards in Calicut contests and Boston clubs.

Purpose

Sort a range or array and spill the result.

Return value

A spilled sorted array.

Syntax

SORT(array, [sort_index], [sort_order], [by_col])

Arguments

ArgumentRequired?Description
arrayRequiredRange to sort.
sort_indexOptionalColumn index to sort by (default 1).
sort_orderOptional1 ascending, −1 descending.
by_colOptionalTRUE sorts by column.

Version

Microsoft 365 / Excel 2021+ with dynamic arrays. LibreOffice limited; Google Sheets has FILTER/SORT/UNIQUE/SEQUENCE/RANDARRAY cousins.

How to use — Why → What → How

Why: Sorting the raw table breaks other formulas. SORT spills an ordered view. Ordered boards in Calicut contests and Boston clubs. In Indian back offices and foreign sister teams, SORT shows up on live dashboards and spill ranges every week.

What: SORT returns a sorted array. sort_order 1 = A→Z / small→large; −1 reverses. Read every argument in the table once before you type; each one changes the answer on purpose.

How — numbered steps:

  1. Type =SORT(A2:B20,2,-1) for high scores first.
  2. Default sorts by first column ascending.
  3. Combine with FILTER.

Ravindra Bagale's Tip

Friends, after SORT, find one column or range in a real workbook this week where this lesson saves time.

Ravindra Bagale's Tip

Friends, sleep on SORT; rebuild example 1 tomorrow without looking.

Ravindra Bagale's Tip

Friends, say the business question in plain words before =SORT.

Ravindra Bagale's Tip

Friends, check a known case with a calculator before you trust a long SORT chain.

Ravindra Bagale's Tip

Friends, after you finish SORT, open yesterday’s real workbook and find one place this function would have saved ten minutes.

Ravindra Bagale's Tip

Friends, treat SORT like a seatbelt on spill ranges — clear #SPILL! blocks first.

Download practice file: practice-sort.xlsx (includes sheet About this data, practice sheets, and Answers).

Worked examples

1) Asc names

Calicut.

Name
Cid
Amy
Ben
Formula: =SORT(A2:A4)

Result: {Amy;Ben;Cid}

What it means: A→Z.

2) Scores desc

Marks.

NameMarks
Asha72
Ben90
Cid85
Formula: =SORT(A2:B4,2,-1)

Result: {Ben,90;Cid,85;Asha,72}

What it means: High first.

3) Boston $

Fees.

$
40
20
60
Formula: =SORT(A2:A4)

Result: {20;40;60}

What it means: Asc.

4) Col 1 desc

Cities.

City
Pune
Austin
Kochi
Formula: =SORT(A2:A4,1,-1)

Result: {Pune;Kochi;Austin}

What it means: Z→A.

5) Single col

Nums.

X
3
1
2
Formula: =SORT(A2:A4)

Result: {1;2;3}

What it means: Simple.

6) With FILTER

Open then sort.

Status₹
Open50
Closed80
Open20
Formula: =SORT(FILTER(B2:B4,A2:A4="Open"))

Result: {20;50}

What it means: Filtered then sorted.

Common errors and fixes

#SPILL! — Blocked. Fix: Clear cells.
#VALUE! — Bad sort_index. Fix: Within column count.
Source unchanged — SORT does not rewrite source. Fix: Expected.

Notes and tips

  • Revisit the SORT errors table after the quiz.
  • Build example 1 from memory on a blank sheet.
  • Check number vs text if a result looks wrong.
  • Teach one tip in Marathi or Hindi this week.
  • Keep currency symbols consistent inside one report column (practice mixes ₹ $ £ €).
  • Drill: sort a three-row scoreboard descending from memory.
  • SORT vs LARGE: full ordered spill versus one nth value.
  • Fictional sample data only — names and amounts are for learning.
  • Print the SORT revision card for one week of real worksheets.
  • Ask juniors to predict before they press Enter.
  • Track your top mistake with this function monthly.
  • Ordered boards in Calicut contests and Boston clubs.
  • Interview tip: explain the business question before the formula.
  • Classroom drill: invent three brand-new formulas from your city without the page open.
  • If a result looks wrong, check blanks vs zeros before rewriting.
  • When Excel versions differ, note the LibreOffice / Sheets fallback in a cell comment.
  • Prefer clear ranges over whole-column refs on huge sheets if speed matters.
  • Document units (₹, kg, days) in the header so totals stay honest.
  • Print the revision card for SORT for one week of real worksheets.
  • When helping a junior, ask them to predict before Enter.
  • Share one tip with a classmate in Marathi or Hindi.
  • Keep currency symbols consistent inside a single report column.
  • Interview tip: explain the business question before the formula.
  • If a result looks wrong, check spill range blocks (#SPILL!) before rewriting.
  • When Excel versions differ, write a LibreOffice / Sheets fallback under a comment.

In real work

Drill: sort a three-row scoreboard descending from memory. Ordered boards in Calicut contests and Boston clubs. Classroom drill: write three brand-new SORT formulas on a blank sheet using names from your own city — if you can invent them without the page open, you own the skill. Then break one formula on purpose and watch the error; recovering from that break is half of interview readiness. Always verify with a known case before trusting a long chain. Keep a personal notebook of the one mistake you make most often with this function; review it monthly.

How it compares

SORT vs LARGE: full ordered spill versus one nth value.

Interview corner

vs SORTBY?
Index vs separate by-array.
order −1?
Descending.
Source?
Unchanged.

SORTBY, FILTER, UNIQUE, LARGE

Practice tasks (10)

  1. Task 1. Sort names A→Z.
    Asc.
  2. Task 2. Scores high first.
    Desc.
  3. Task 3. Fees asc.
    $.
  4. Task 4. Z→A cities.
    Desc text.
  5. Task 5. FILTER+SORT.
    Combo.
  6. Task 6. Interview.
    Talk.
  7. Task 7. Teach.
    Teach.
  8. Task 8. Clear spill.
    Space.
  9. Task 9. Fill board.
    Fill.
  10. Task 10. Document.
    Note.

Quick quiz

Q1. sort_order −1?
Q2. Default index?
Q3. Rewrites source?
Q4. Blocked spill?
Q5. High scores first index+order?

Answers: Q1=Descending, Q2=1, Q3=No, Q4=#SPILL!, Q5=2 and −1 (check after you try).

Revision card

Standalone card (no tip or photo strip). QR opens this lesson. Download the PNG and revise offline.

Revision card: SORT
SORT revision card