Excel for analyst roles: 20 formulas + pivot tables
XLOOKUP, SUMIFS, IF, TEXT, pivot tables and the mini-project that proves you can use them.
How to use this guide
Analyst and MIS interviews test Excel hands-on. Every formula below uses one sales table, shows the formula and the result it gives, and ends with practice questions and a pivot-table walkthrough.
1. The table we use
| A Date | B City | C Product | D Units | E Price | |
|---|---|---|---|---|---|
| 2 | 01-06-2024 | Pune | Tea | 10 | 20 |
| 3 | 01-06-2024 | Hyderabad | Coffee | 5 | 40 |
| 4 | 02-06-2024 | Pune | Coffee | 8 | 40 |
| 5 | 03-06-2024 | Chennai | Tea | 12 | 20 |
| 6 | 03-06-2024 | Pune | Tea | 6 | 20 |
2. The 20 formulas
Definition: Lookup functions search for a value in one range and return a corresponding value from another range.
How it works: VLOOKUP(value, table, col_index, FALSE) searches the first column of a table and returns the value from a given column (exact match with FALSE). XLOOKUP(value, lookup_range, return_range, if_not_found) can look in any direction, defaults to exact match and handles missing values.
Example: Find a city's revenue: =XLOOKUP("Chennai", B2:B6, F2:F6) โ 240.
๐ง In simple words
| # | Formula | Result | Use |
|---|---|---|---|
| 1 | =D2*E2 | 200 | revenue for one row (copy down to F) |
| 2 | =SUM(F2:F6) | 1,080 | total revenue |
| 3 | =AVERAGE(D2:D6) | 8.2 | average units |
| 4 | =COUNTIF(B2:B6,"Pune") | 3 | rows from Pune |
| 5 | =SUMIF(B2:B6,"Pune",F2:F6) | 640 | Pune revenue |
| 6 | =SUMIFS(F2:F6,B2:B6,"Pune",C2:C6,"Tea") | 320 | Pune tea revenue |
| 7 | =AVERAGEIF(C2:C6,"Tea",D2:D6) | 9.33 | average tea units |
| 8 | =MAX(F2:F6) | 320 | biggest sale |
| 9 | =IF(F2>=300,"High","Normal") | Normal | label rows |
| 10 | =XLOOKUP("Chennai",B2:B6,F2:F6) | 240 | find a value |
| 11 | =VLOOKUP("Chennai",B2:F6,5,FALSE) | 240 | older lookup |
| 12 | =INDEX(F2:F6,MATCH("Chennai",B2:B6,0)) | 240 | flexible lookup |
| 13 | =IFERROR(XLOOKUP("Delhi",B2:B6,F2:F6),"Not found") | Not found | hide errors |
| 14 | =TEXT(A2,"mmm yyyy") | Jun 2024 | format dates |
| 15 | =UPPER(C2) / =TRIM(B2) | TEA | clean text |
| 16 | =LEFT(B3,3) | Hyd | part of text |
| 17 | =CONCAT(B2," - ",C2) | Pune - Tea | join text |
| 18 | =UNIQUE(B2:B6) | Pune, Hyderabad, Chennai | distinct list |
| 19 | =SORT(F2:F6,,-1) | 320, 240, 200, 200, 120โฆ | sort |
| 20 | =COUNTA(B2:B6) | 5 | non-empty cells |
Revenue column F (Units ร Price): 200, 200, 320, 240, 120.
=D2*$H$1 keeps H1 fixed (e.g. a GST rate) while D2 moves as you copy down.
3. Pivot table in 5 steps
Definition: A pivot table is an interactive summary table that groups, aggregates and reorganises large data sets by dragging fields into rows, columns, values and filters.
How it works: It computes sums, counts, averages or percentages per group without formulas, and updates when the source data is refreshed. Power BI and SQL GROUP BY are the same idea.
Example: Revenue by city (rows) and product (columns).
๐ง In simple words
- Click any cell in the table โ Insert โ PivotTable.
- Drag City to Rows.
- Drag Revenue to Values (Sum).
- Drag Product to Columns.
- Right-click a number โ Show Values As โ % of Grand Total.
Sum of Revenue | Coffee | Tea | Total Chennai | 0 | 240 | 240 Hyderabad | 200 | 0 | 200 Pune | 320 | 320 | 640 Total | 520 | 560 | 1080
4. Practice (answers hidden)
- What is the total revenue (F2:F6)?
Show answer
200 + 200 + 320 + 240 + 120 = 1,080.
- Revenue from Coffee only?
Show answer
=SUMIF(C2:C6,"Coffee",F2:F6) โ 200 + 320 = 520.
- Pune tea revenue?
Show answer
=SUMIFS(F2:F6,B2:B6,"Pune",C2:C6,"Tea") โ 200 + 120 = 320.
5. Your 7-day Excel plan
| Day | Do |
|---|---|
| 1 | Formulas 1โ9 on a sample sheet |
| 2 | Lookups 10โ13 |
| 3 | Text & date 14โ20 |
| 4 | Pivot tables + charts |
| 5 | Data cleaning (duplicates, text to columns) |
| 6 | Build a one-page sales dashboard |
| 7 | Timed test: 10 tasks in 30 minutes |