Formulas for real jobs
Start from the job you need done. Each recipe gives the Excel and Google Sheets versions, with a short explanation.
Two-way lookup by row and columnLookup
=XLOOKUP(G2,A2:A10,XLOOKUP(G3,B1:E1,B2:E10))=XLOOKUP(G2,A2:A10,XLOOKUP(G3,B1:E1,B2:E10))The inner XLOOKUP picks the column for G3. The outer one picks the row for G2.
Sum values between two datesSum
=SUMIFS(C:C,A:A,">="&F1,A:A,"<="&F2)=SUMIFS(C:C,A:A,">="&F1,A:A,"<="&F2)Two tests on the date column set the start and end. The & joins each operator with its date cell.
Count unique valuesCount
=COUNTA(UNIQUE(A2:A100))=COUNTUNIQUE(A2:A100)UNIQUE removes repeats and COUNTA counts what is left. Keep the range free of blanks in Excel, or add FILTER first.
Return the last value in a columnLookup
=XLOOKUP(TRUE,A2:A100<>"",A2:A100,,,-1)=INDEX(FILTER(A2:A100,A2:A100<>""),COUNTA(A2:A100))The Excel version searches upward for the first non-blank cell. The Sheets version keeps non-blank cells and picks the last one.
Split a full name into two cellsText
=TEXTSPLIT(A2," ")=SPLIT(A2," ")The space marks each break. Results spill to the right, so keep those cells empty.
Create a sorted list with no duplicatesDynamic arrays
=SORT(UNIQUE(A2:A100))=SORT(UNIQUE(A2:A100))UNIQUE removes repeats and SORT orders the result. The list updates with the source.
Count workdays with a Friday and Saturday weekendDates
=NETWORKDAYS.INTL(A2,B2,7,Holidays)=NETWORKDAYS.INTL(A2,B2,7,Holidays)Weekend code 7 means Friday and Saturday. Code 1 means Saturday and Sunday. Holidays is a named range of dates.
Calculate age in yearsDates
=DATEDIF(A2,TODAY(),"Y")=DATEDIF(A2,TODAY(),"Y")DATEDIF counts complete years from the birth date in A2 to today.
Build a running totalSum
=SUM($B$2:B2)=SUM($B$2:B2)The first reference stays fixed and the second grows as you fill the formula down.
Extract the domain from an email addressText
=TEXTAFTER(A2,"@")=REGEXEXTRACT(A2,"@(.+)$")Both return the text after the @ sign.
Total sales by category with one formulaSummaries
=GROUPBY(A2:A100,C2:C100,SUM)=QUERY(A1:C100,"select A, sum(C) group by A",1)Both return a live summary with one row per category.
Show the top five rows by valueDynamic arrays
=TAKE(SORT(A2:B100,2,-1),5)=SORTN(A2:B100,5,0,2,FALSE)Both sort by the second column from high to low and keep five rows.