XLOOKUP, VLOOKUP or INDEX/MATCH? Lookups and SUMIFS Explained

Which lookup formula to use and why, how SUMIFS criteria work, and how to build nested IF formulas, with examples you can try on your own table.
Most spreadsheet work comes down to two questions: "find the matching row" and "add up the rows that match". Here is how the main formulas answer them, with a small example table.
Picture a sheet with Product in column A, Code in B, Region in C, Price in D, Sold in E and Status in F, and six products in rows 2 to 7.
Three ways to look something up
You want the price of product code K-300.
- VLOOKUP: =VLOOKUP("K-300",B2:D7,3,FALSE) looks in the first column of B2:D7 and returns the 3rd column. FALSE means an exact match.
- XLOOKUP: =XLOOKUP("K-300",B2:B7,D2:D7,"Not found",0) names the column to search and the column to return directly.
- INDEX/MATCH: =INDEX(D2:D7,MATCH("K-300",B2:B7,0)) finds the row number with MATCH, then picks from the Price column with INDEX.
All three return 39.99 here. The difference shows when things change. VLOOKUP counts columns, so inserting a column in the middle breaks it, and it can only return columns to the right of the search column. XLOOKUP and INDEX/MATCH have neither problem. XLOOKUP needs a fairly recent spreadsheet version; INDEX/MATCH works almost everywhere.
For price bands and tax tables, use "exact or next smaller": looking up 7 in bands 0, 5 and 10 gives the row for 5. VLOOKUP and MATCH need that column sorted from small to large.
SUMIFS: add up only the rows you want
To add up Sold where Region is North and Price is at least 10:
=SUMIFS(E2:E7,C2:C7,"North",D2:D7,">=10")
The criteria are text in quotes. A plain value means "equals" and ignores capital letters. Put >, >=, <, <= or <> in front to compare. In text, an asterisk stands for any letters and a question mark for one letter, so "T" followed by an asterisk matches Teapot and Tray. COUNTIFS uses the same criteria to count rows, and AVERAGEIFS averages them.
IF and IFS: grades and categories
To turn a score in B2 into a grade:
=IF(B2>=90,"A",IF(B2>=75,"B","Fail"))
The rules are checked from the left, so the highest band must come first. IFS writes the same thing without the nesting: =IFS(B2>=90,"A",B2>=75,"B",TRUE,"Fail"), where TRUE catches everything else.
Try it on your own data
The Spreadsheet formula builder builds these formulas for a table you paste, with the right cell ranges. It also works out the answer, so you can check the formula before you copy it into your sheet. If your spreadsheet uses semicolons between arguments, as many European settings do, switch the separator first. To clean up the table before you start, try CSV studio.