Excel test prep · Lesson 5 of 9
Excel formulas test: 24 questions on lookups, IF and SUMIFS
Practice Excel formulas test for interviews: 24 questions on XLOOKUP, VLOOKUP, INDEX/MATCH, IF, IFS, SUMIFS, COUNTIFS, text and dates, with answers.
Formula questions are the core of almost every Excel assessment, at every level. This test has 24 questions on lookups, IF logic, conditional sums and counts, text, dates and rounding. Allow about 30 minutes. Every question uses the staff table below, so you can check each answer in real Excel by typing the table into a blank sheet starting at A1.
The explanations link to the function pages and to the lessons Lookup guide: VLOOKUP vs INDEX/MATCH vs XLOOKUP, IF and logical formulas: AND, OR, NOT, IFS and SWITCH and Counting and summing with criteria: COUNTIFS, SUMIFS, SUMPRODUCT. Dates in column E are real Excel dates, shown here in year-month-day form.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | ID | Name | Dept | Salary | Start |
| 2 | E01 | Ana | Sales | 42000 | 2019-04-01 |
| 3 | E02 | Ben | IT | 55000 | 2021-09-15 |
| 4 | E03 | Cara | Sales | 47000 | 2023-01-09 |
| 5 | E04 | Dev | HR | 39000 | 2018-11-20 |
| 6 | E05 | Eli | IT | 61000 | 2016-06-01 |
| 7 | E06 | Fay | Sales | 51000 | 2020-07-13 |
| 8 | E07 | Gus | HR | 44000 | 2024-03-04 |
Staff table in A1:E8, used by every question on this page. Column E holds dates.
Part 1: Lookups
1. What does =XLOOKUP("E05",A2:A8,B2:B8) return?
XLOOKUP finds E05 in A2:A8 (the 5th item) and returns the 5th item of B2:B8. The lookup and return ranges are separate, which makes it easy to read. See Lookup guide: VLOOKUP vs INDEX/MATCH vs XLOOKUP.
2. What does =VLOOKUP("E03",A2:E8,4,FALSE) return?
Column 4 of A2:E8 is D, Salary. E03 is Cara, whose salary is 47000. Counting columns is the most common VLOOKUP mistake: the number is relative to the range, not to the sheet.
3. What does =INDEX(B2:B8,MATCH(MAX(D2:D8),D2:D8,0)) return?
MAX gives 61000, MATCH finds it at position 5, and INDEX returns the 5th name. This answers "who earns the most?" without sorting.
4. What does =XLOOKUP("E09",A2:A8,B2:B8,"Unknown") return?
E09 does not exist. The 4th argument of XLOOKUP, if_not_found, replaces the #N/A error with your own text, so there is no need for IFERROR.
5. What does =MATCH("HR",C2:C8,0) return?
MATCH returns a position, not a value. The first HR in C2:C8 is the 4th cell (Dev). The 0 asks for an exact match.
6. Which formula returns the ID of the employee named Fay?
The ID column is to the left of the names, so VLOOKUP cannot do it: it would look for Fay in column A and return #N/A. XLOOKUP (or =INDEX(A2:A8,MATCH("Fay",B2:B8,0))) returns E06.
7. What does =XLOOKUP(50000,D2:D8,B2:B8,,1) return?
match_mode 1 means "exact match, or else the next larger value". No salary is exactly 50000; the smallest salary above it is 51000 (Fay). The list does not need to be sorted for XLOOKUP.
Part 2: IF and logic
8. What does =IF(AND(C3="IT",D3>50000),"Senior","Other") return?
Row 3 is Ben: IT and 55000. Both conditions are true, so AND is TRUE and IF returns Senior. See IF and logical formulas: AND, OR, NOT, IFS and SWITCH.
9. What does =IFS(D2>=60000,"A",D2>=45000,"B",TRUE,"C") return?
IFS returns the result for the first true condition. Ana's 42000 fails the first two tests, so the final TRUE acts as a catch-all and returns C. Without it, IFS would return #N/A.
10. What does =SWITCH(C5,"Sales",1,"IT",2,0) return?
C5 is HR, which matches neither Sales nor IT. The last, unpaired argument of SWITCH is the default, 0.
11. What does =IF(OR(C8="HR",D8>50000),"Yes","No") return?
Gus is in HR, so the first condition is TRUE. OR needs only one true condition, even though his salary is not above 50000.
12. Find the bug: =IF(D2>40000,"High",IF(D2>50000,"Very high","Low")). Which statement is true?
Nested IFs are checked in order and stop at the first TRUE. Test the highest threshold first: =IF(D2>50000,"Very high",IF(D2>40000,"High","Low")).
13. What does =COUNTIF(D2:D8,">"&D2) return?
The condition becomes ">42000". Salaries above Ana's 42000 are 55000, 47000, 61000, 51000 and 44000. Joining the operator and the cell with & is how you use a cell value in a condition; ">D2" would compare with the text D2.
Part 3: Conditional sums and counts
14. What does =SUMIFS(D2:D8,C2:C8,"Sales") return?
Sales salaries are 42000 + 47000 + 51000 = 140000. See SUMIFS and Counting and summing with criteria: COUNTIFS, SUMIFS, SUMPRODUCT.
15. What does =COUNTIFS(C2:C8,"IT",D2:D8,">=55000") return?
Both IT employees qualify: Ben at exactly 55000 (the condition includes equals) and Eli at 61000.
16. What does =AVERAGEIFS(D2:D8,C2:C8,"HR") return?
HR salaries are 39000 and 44000; their average is 83000 / 2 = 41500. See AVERAGEIFS.
17. What does =SUMIFS(D2:D8,E2:E8,">="&DATE(2021,1,1)) return?
Employees who started on or after 1 January 2021 are Ben (55000), Cara (47000) and Gus (44000). Building the date with DATE avoids problems with regional date formats inside text conditions.
18. What does =SUMPRODUCT((C2:C8="Sales")*(D2:D8>45000)) return?
Each comparison gives an array of TRUE/FALSE; multiplying makes 1 where both are true. Cara (47000) and Fay (51000) qualify, Ana does not. Summing the 1s counts them, just like COUNTIFS.
Part 4: Text, dates and rounding
20. What does =DATEDIF(E2,DATE(2026,12,31),"y") return?
Ana started on 1 April 2019. By 31 December 2026 she has completed 7 full years (her 8th anniversary is in April 2027). DATEDIF with "y" counts whole years only.
21. A bonus is 3.3% of salary, rounded up to the next hundred. What does =ROUNDUP(D5*0.033,-2) return?
D5 is 39000, and 39000 * 0.033 = 1287. A negative number of digits rounds to the left of the decimal point: -2 means hundreds. ROUNDUP always rounds away from zero, so 1287 becomes 1300; ROUND would give 1300 too, but ROUNDDOWN would give 1200.
22. What does =TEXTJOIN(", ",TRUE,FILTER(B2:B8,C2:C8="HR")) return?
FILTER returns the HR names, and TEXTJOIN joins them with a comma and a space, skipping empty values because of TRUE. Microsoft 365 or Excel 2021 is needed for FILTER.
23. What does =UPPER(LEFT(B4,3))&"-"&RIGHT(A4,2) return?
B4 is Cara: LEFT takes Car and UPPER makes it CAR. A4 is E03: RIGHT takes the last two characters, 03. Codes like this are a typical test task. See Text cleanup: TRIM, CLEAN, TEXTSPLIT, Flash Fill and Text to Columns.
24. What does =YEAR(E5) return?
E5 is Dev's start date, 20 November 2018. YEAR extracts the year as a number. MONTH would return 11, and the cell's underlying serial number is what Excel stores. See Dates and times: serial numbers, date math and working days.
More practice: Pivot table and data test: 23 practice questions for summarising data, and Practical Excel test: 8 interview tasks with model answers for a full case where you choose the formulas yourself.