SORTBY in Apple Numbers
Short answer: SORTBY sorts a range by the values in another range. Syntax:
SORTBY(array, sort-by-array, sort-order, …)Explanation
SORTBY sorts a range by the values in another range. That way you can sort names by price without having to show the prices themselves.
Syntax
SORTBY(array, sort-by-array, sort-order, …)Example
Sort the product names (A2:A5) by price (B2:B5), low to high, and join them with a comma and a space.
| A | B | C | |
|---|---|---|---|
| 1 | Product | Price | Qty |
| 2 | Apple | 4 | 10 |
| 3 | Pear | 6 | 5 |
| 4 | Kiwi | 12 | 2 |
| 5 | Grape | 8 | 3 |
Formula: =TEXTJOIN(", ",TRUE,SORTBY(A2:A5,B2:B5))
Result: Apple, Pear, Grape, Kiwi
Frequently asked questions
What does SORTBY do in Apple Numbers?
SORTBY sorts a range by the values in another range. That way you can sort names by price without having to show the prices themselves.
What is the syntax of SORTBY?
The syntax is SORTBY(array, sort-by-array, sort-order, …).
More in this category
Read more
Practise it yourself
Type the formula yourself in a real exercise and see right away if your answer is correct. The first exercises are free.
Start practising