Formulas for

Sort Lines of Text

Text Processing1 credit/cellSheets · Excel
=VERVE("linesorter", "[""The quick brown fox jumps over the lazy dog"",""An apple a day keeps the doctor away"",""banana"",""Cherry blossoms bloom in spring"",""date""]", "field", "lineCount")

Alphabetize text by the row. Sorts lines ascending or descending down a column — Google Sheets or Excel.

It's one of 250+ live sources you reach with a single =VERVE() function — served from APIVerve's production data engine, billed at 1 credit per resolved cell, and refreshed on whatever cadence you set. No API keys to wrangle, no scripts, no exports.

A real example — the input you type, and the values you can pull from it. Click any cell to see the formula behind it.

linesorter.xlsxsample data
B2fx=VERVE("linesorter", A2, "field", "lineCount")
A
B
C
D
1
Lines
Line Count
Order
Case Sensitive
2
["The quick brown fox jumps over the lazy dog","An apple a day keeps the doctor away","banana","Cherry blossoms bloom in spring","date"]
5
asc
FALSE
3
4
click any cell to see its formula1 credit / cell

Clean a column of text

Fill =VERVE("linesorter", "[""The quick brown fox jumps over the lazy dog"",""An apple a day keeps the doctor away"",""banana"",""Cherry blossoms bloom in spring"",""date""]", "field", "lineCount") beside messy text and get the normalized, analyzed, or translated version back — data cleaning without leaving the grid.

Analyze at scale

Score or classify a whole column of responses, reviews, or messages in one fill instead of one-by-one.

Compose with other formulas

Nest Sort Lines of Text's output inside your existing SUM, IF, or CONCAT logic like any other cell value.

The same function works in both apps — install once, sign in with your key, and type it into any cell.

Google SheetsAdd-on

Install from the Workspace Marketplace, then drop the formula into a cell. Autocomplete suggests the source and its fields.

=VERVE("linesorter", "[""The quick brown fox jumps over the lazy dog"",""An apple a day keeps the doctor away"",""banana"",""Cherry blossoms bloom in spring"",""date""]", "field", "lineCount")
Microsoft ExcelAdd-in

Same source, same arguments, same key — in Excel on desktop, the web, or mobile. Excel namespaces it as VERVE.CALL. Drag to fill a whole column.

=VERVE.CALL("linesorter", "[""The quick brown fox jumps over the lazy dog"",""An apple a day keeps the doctor away"",""banana"",""Cherry blossoms bloom in spring"",""date""]", "field", "lineCount")

Tune the result by adding name=value before the field argument — in any order. Leave one out and its default applies.

  • order

    Sort order

    =VERVE("linesorter", "[""The quick brown fox jumps over the lazy dog"",""An apple a day keeps the doctor away"",""banana"",""Cherry blossoms bloom in spring"",""date""]", "order", "asc")
  • caseSensitive

    Enable case-sensitive sorting

    =VERVE("linesorter", "[""The quick brown fox jumps over the lazy dog"",""An apple a day keeps the doctor away"",""banana"",""Cherry blossoms bloom in spring"",""date""]", "caseSensitive", "false")

Add a field name as the last argument to land just that value in the cell.

  • Sorted
    =VERVE("linesorter", "[""The quick brown fox jumps over the lazy dog"",""An apple a day keeps the doctor away"",""banana"",""Cherry blossoms bloom in spring"",""date""]", "field", "sorted")
  • Line Count
    =VERVE("linesorter", "[""The quick brown fox jumps over the lazy dog"",""An apple a day keeps the doctor away"",""banana"",""Cherry blossoms bloom in spring"",""date""]", "field", "lineCount")
  • Order
    =VERVE("linesorter", "[""The quick brown fox jumps over the lazy dog"",""An apple a day keeps the doctor away"",""banana"",""Cherry blossoms bloom in spring"",""date""]", "field", "order")

Sort Lines of Text, answered

Everything you need to wire it into a sheet.

How do I pull Sort Lines of Text into Google Sheets?
Install the VerveSheets add-on, sign in once with your key, and type =VERVE("linesorter", "[""The quick brown fox jumps over the lazy dog"",""An apple a day keeps the doctor away"",""banana"",""Cherry blossoms bloom in spring"",""date""]", "field", "sorted") into any cell. The "field" argument names the value you want back, so the cell resolves to a single number or string you can chart, sort, or feed into another formula.
What data can I pull from Sort Lines of Text?
Sort Lines of Text returns sorted, lineCount and order — name any one of them as the "field" argument and that value lands in the cell. Leave the field out and the whole record spills into a two-column table instead.
Can I narrow what Sort Lines of Text returns?
Yes — Sort Lines of Text takes "order" and "caseSensitive" as optional inputs. They go in as "name", value pairs after the required ones, in any order, so =VERVE("linesorter", "[""The quick brown fox jumps over the lazy dog"",""An apple a day keeps the doctor away"",""banana"",""Cherry blossoms bloom in spring"",""date""]", "order", "asc") shapes the result without changing anything else.
Can I fill a whole column of Sort Lines of Text at once?
Yes. Put your lines values down a column and point the formula at the range — A2:A50 instead of A2 — and one call returns a value for every row. Dragging the formula down works too, but the range form is a single billed call per column rather than one per cell.
How many credits does each Sort Lines of Text cell cost?
Each resolved cell costs 1 credit. A cell only re-bills when it actually refreshes, so a sheet you aren't touching doesn't keep charging.
Does Sort Lines of Text work in Excel as well as Google Sheets?
Yes — same arguments, same key, same fields. Excel namespaces custom functions, so the call is =VERVE.CALL() there and =VERVE() in Google Sheets; nothing else about it changes.

Put Sort Lines of Text in your next spreadsheet. Add the extension, paste the formula, and the cell keeps itself current.

Scaling up?

Volume pricing, custom SLAs, and dedicated support for high-traffic teams.

Contact sales