Sheet Clinic

Excel functions Google Sheets doesn't have, and what to use instead

TEXTBEFORE, SORTBY and GROUPBY return #NAME? in Google Sheets. Swap in LEFT with FIND, SORT and QUERY, and change -1 to FALSE in a copied SORT.

Sheet Clinic editorsPublished
G2=LEFT(A2,FIND(" ",A2)-1)

Before Excel names

EFG
1TaskFormulaResult
2First name=TEXTBEFORE(A2," ")#NAME?
3Last name=TEXTAFTER(A2," ")#NAME?
4Name split into two cells=TEXTSPLIT(A2," ")#NAME?
5Most hours (name)=INDEX(SORTBY(A2:A7,C2:C7,-1),1)#NAME?
6First three names in one cell=CONCAT(A2:A4)#N/A
7Emily's share of all hours=PERCENTOF(C2,C2:C7)#NAME?
8Name starts with E=REGEXTEST(A2,"^E")#NAME?
9Most hours, skipping errors=AGGREGATE(14,6,C2:C7,1)#NAME?
10Hours as text=VALUETOTEXT(C2)#NAME?
11Hours by team=GROUPBY(B2:B7,C2:C7,SUM)#NAME?

What changed

  1. G2:G11 rewritten with Sheets functions
  2. F2:F11 shows each new formula through FORMULATEXT

After Sheets names

EFG
1TaskFormulaResult
2First name=LEFT(A2,FIND(" ",A2)-1)Emily
3Last name=INDEX(SPLIT(A2," "),2)Carter
4Name split into two cells=SPLIT(A2," ")Emily
5Most hours (name)=INDEX(SORT(A2:A7,C2:C7,FALSE),1)Michael Reed
6First three names in one cell=TEXTJOIN(", ",TRUE,A2:A4)Emily Carter, Jacob Nguyen, Sarah Brooks
7Emily's share of all hours=C2/SUM(C2:C7)0.2
8Name starts with E=REGEXMATCH(A2,"^E")TRUE
9Most hours, skipping errors=MAX(FILTER(C2:C7,ISNUMBER(C2:C7)))45
10Hours as text=TO_TEXT(C2)40
11Hours by team=QUERY(A1:C7,"select B, sum(C) group by B",1)Team
Figure 1. Ten jobs on the same six rows of names and hours. Excel formulas typed into Sheets on the left, their Sheets replacements on the right.

An Excel formula typed into Google Sheets comes back #NAME? when Sheets has no function by that name, and selecting the cell opens a red box with one line, such as Unknown function: 'TEXTBEFORE'. The formula has to be rewritten with a Sheets function that does the same job. In the take-home copy, G2 of the Broken tab holds =TEXTBEFORE(A2," ") to pull a first name. On the Fixed tab the same cell holds =LEFT(A2,FIND(" ",A2)-1) and returns Emily.

Column G of the Broken tab holds ten small jobs on the same six rows of names, teams and hours, each written the way Excel writes it, and nine of them show that error. Google keeps a list of every Sheets function, and TEXTBEFORE, TEXTAFTER, TEXTSPLIT, SORTBY, PERCENTOF, REGEXTEST, AGGREGATE, VALUETOTEXT and GROUPBY are not on it. Their replacements on the Fixed tab, in that order, are LEFT with FIND, SPLIT with INDEX, SPLIT alone, SORT, plain division, REGEXMATCH, MAX around FILTER, TO_TEXT and QUERY.

CONCAT and SORT are a different case, because both names exist in Sheets. CONCAT given a range came back #N/A, and TEXTJOIN does that job. A SORT that carries Excel's -1 for descending order shows no error at all and sorts ascending: =INDEX(SORT(A2:C7,3,-1),1,1) returned David Kim, who has 20 hours, the fewest of the six, where the Excel version is meant to return Michael Reed, who has 45. In Sheets the -1 has to become FALSE.

TEXTBEFORE, TEXTAFTER and TEXTSPLIT become LEFT, FIND and SPLIT

G2, G3 and G4 of the Broken tab hold Excel's three newer text functions, and each shows #NAME?.

Broken tab with G2 selected. The formula bar shows =TEXTBEFORE(A2," "). Column G shows #NAME? in nine rows and #N/A in G6, and the note beside G2 reads: Error Unknown function: 'TEXTBEFORE'.
Figure 2. The Broken tab with G2 selected. The note beside it names the function Sheets does not have.

LEFT, FIND and SPLIT did all three jobs on the Fixed tab:

  • First name: =LEFT(A2,FIND(" ",A2)-1) returned Emily. FIND gives the position of the space, and LEFT keeps everything before it.
  • Last name: =INDEX(SPLIT(A2," "),2) returned Carter. SPLIT breaks the name at the space and INDEX picks the second piece.
  • Split into cells: =SPLIT(A2," ") in G4 returned Emily, and Carter appeared in H4. SPLIT spills across, so the cell to the right has to be free.

In all three, A2 is the cell with the full name and the space in quotes is the separator. Those are the two parts to change for your own data.

Sheets formulas for SORTBY, PERCENTOF, REGEXTEST, AGGREGATE, VALUETOTEXT and GROUPBY

Every result below is what the Fixed tab returned for the other six Excel-only names in column G.

=INDEX(SORTBY(A2:A7,C2:C7,-1),1) on the Broken tab asks for the name with the most hours. Sheets has no SORTBY, but its SORT takes a separate range to sort by, so =INDEX(SORT(A2:A7,C2:C7,FALSE),1) returned Michael Reed, the row with 45 hours.

PERCENTOF is plain division in Sheets. =C2/SUM(C2:C7) returned 0.2, since Emily has 40 of the hours. Format the cell as a percent if you want it to read that way. REGEXTEST maps to REGEXMATCH with the same two arguments, and =REGEXMATCH(A2,"^E") returned TRUE. VALUETOTEXT maps to TO_TEXT, and =TO_TEXT(C2) returned 40 as text, which you can see because it sits against the left edge of G10 while the numbers above it sit on the right.

AGGREGATE takes a number for the job and a number for what to skip. Microsoft's AGGREGATE page lists 14 as LARGE and option 6 as "Ignore error values," so =AGGREGATE(14,6,C2:C7,1) is the largest value with error cells left out. Sheets has no AGGREGATE. In =MAX(FILTER(C2:C7,ISNUMBER(C2:C7))), FILTER keeps only the cells that are numbers and MAX takes the largest of those. It returned 45.

GROUPBY needs the longest replacement. On the Fixed tab, =QUERY(A1:C7,"select B, sum(C) group by B",1) builds the summary in G11:H14. Inside the quotes, B is the column to group by and C is the column to add up, and A1:C7 is the data with its header row. The last argument tells QUERY the data has one header row (the QUERY page says it guesses when you leave it out). It returned a header row of Team and sum Hours, then Ops 41, Sales 78 and Support 81. QUERY needs empty cells below and to the right for that result.

Fixed tab with G11 selected. The formula bar shows =QUERY(A1:C7,"select B, sum(C) group by B",1). Column G shows Emily, Carter, Emily and Carter, Michael Reed, Emily Carter, Jacob Nguyen, Sarah Brooks, 0.2, TRUE, 45, 40, and a Team and sum Hours table with Ops 41, Sales 78, Support 81.
Figure 3. The Fixed tab. Column F is the Sheets formula behind each result in column G.

CONCAT takes exactly two values in Sheets, so a range needs TEXTJOIN

Row 6 of the Broken tab holds the one Excel name in column G that Sheets recognized. =CONCAT(A2:A4) returned #N/A instead of #NAME?, and the note on G6 reads: Wrong number of arguments to CONCAT. Expected 2 arguments, but got 1 arguments.

For a range, Sheets has TEXTJOIN under the same name Excel uses. =TEXTJOIN(", ",TRUE,A2:A4) on the Fixed tab returned Emily Carter, Jacob Nguyen, Sarah Brooks. The first argument is the text placed between the names, and the TRUE skips empty cells.

Google's CONCAT page gives the syntax as CONCAT(value1, value2) and says it "Returns the concatenation of two values." Excel's CONCAT page lists CONCAT(text1, [text2],…) and describes the first argument as "A string, or array of strings, such as a range of cells," which is why the Excel habit is to hand it a whole range. In Sheets a range counts as one argument, so A2:A4 is one argument where two were expected. On the More functions tab, =CONCAT(A2,B2) returned Emily CarterSales, with no space, exactly two values joined.

Broken tab with G6 selected. The formula bar shows =CONCAT(A2:A4), G6 shows #N/A, and the note reads: Error Wrong number of arguments to CONCAT. Expected 2 arguments, but got 1 arguments.
Figure 4. Same name in both programs, different argument count.

SORT copied from Excel: -1 sorts ascending in Sheets and shows no error

In Excel, SORT(A2:C7,3,-1) sorts the rows by the third column, and the Excel SORT page gives a sort order of "-1 for descending order." Wrapped in INDEX to take the first name, the Excel version is meant to pick Michael Reed.

On the More functions tab, G12 holds that formula and shows David Kim with no error mark. Google's SORT page describes the third argument as "TRUE or FALSE indicating whether to sort sort_column in ascending order." Sheets did not reject the -1. It sorted the list ascending, so the top row was the smallest value.

For any SORT copied from an Excel file, change -1 to FALSE, which sorts descending. The SORT formula in G5 of the Fixed tab ends in FALSE and returned Michael Reed.

More functions tab with G12 selected. The formula bar shows =INDEX(SORT(A2:C7,3,-1),1,1) and G12 shows David Kim. Column C shows 20 for David Kim and 45 for Michael Reed.
Figure 5. No error mark on G12. The result is the bottom of the list, not the top.

XLOOKUP, LET and VSTACK run under their Excel names; TAKE does not

These formulas on the More functions tab returned a value exactly as Excel writes them: =XLOOKUP("Sarah Brooks",A2:A7,C2:C7) gave 38, =XMATCH(45,C2:C7) gave 4, =LET(total,SUM(C2:C7),C2/total) gave 0.2, =SUM(MAP(C2:C7,LAMBDA(h,MAX(h-40,0)))) gave 5 (Michael's hours over 40), =TEXTJOIN(", ",TRUE,FILTER(A2:A7,B2:B7="Sales")) gave Emily Carter, Sarah Brooks, =COUNTA(UNIQUE(B2:B7)) gave 3, =IFS(C2>=40,"Full",C2<40,"Part") gave Full, =CHOOSECOLS(A2:C2,3) gave 40 and =ROWS(VSTACK(A2:C4,A5:C7)) gave 6.

TAKE, tested in the same column, did not. =TAKE(A2:A7,-1) in G14 returned #NAME? with the note Unknown function: 'TAKE'. For the last row, =CHOOSEROWS(A2:A7,-1) in G9 returned David Kim, so a negative number in CHOOSEROWS counted up from the bottom of the range.

More functions tab with G14 selected. The formula bar shows =TAKE(A2:A7,-1), G14 shows #NAME?, and the note reads: Error Unknown function: 'TAKE'. Rows 2 to 13 show results for XLOOKUP, XMATCH, LET, MAP, TEXTJOIN, UNIQUE, IFS, CHOOSEROWS, CHOOSECOLS, VSTACK, SORT and CONCAT.
Figure 6. The More functions tab. Everything above row 14 ran under its Excel name.

A whole workbook opened in Sheets has more to check than function names. Links to a second workbook, CELL("filename"), data bars and pivot tables are covered in the post on what breaks when an Excel file is opened in Sheets.

Rewriting the ten Excel formulas on the Try it yourself tab

Column G of the Try it yourself tab still holds the ten Excel formulas and their #NAME? results. Work down it from G2 to G11, typing into each cell the formula that column F of the Fixed tab shows for the same row. Column F is built with FORMULATEXT, so it displays the formula without holding it. Type what it shows, or copy the G cell from the Fixed tab. Column F on the Try it yourself tab updates as you go, since it reads column G. G2 should turn into Emily, G5 into Michael Reed, G7 into 0.2 and G9 into 45. When G2:G11 matches the Fixed tab, the QUERY totals appear in G12:H14.

Input6 rows of names, teams and hours in A2:C7
Formula=QUERY(A1:C7,"select B, sum(C) group by B",1)
ExpectedTeam, sum Hours, Ops, 41, Sales, 78, Support, 81
Sheets returnedTeam, sum Hours, Ops, 41, Sales, 78, Support, 81 Matches expected
Checked2026-11-12, free personal account

Take-home copy. Four tabs: Broken (as you see it), Fixed, Try it yourself, More functions. It opens as a copy in your own Drive.

Copy the sheet