Excel IFS Practice Question: Write the department name from the code start: HR is Human Resources, FIN is…
The question
Write the department name from the code start: HR is Human Resources, FIN is Finance, ENG is Engineering, anything else is Other. Put it in B2 to B5.
The data
| A | B | |
|---|---|---|
| 1 | Code | Department |
| 2 | HR-1 | ? |
| 3 | FIN-2 | ? |
| 4 | ENG-3 | ? |
| 5 | OPS-4 | ? |
The yellow cells are where your answer goes.
Show answer
Expected results:
- B2 = Human Resources
- B3 = Finance
- B4 = Engineering
- B5 = Other
How it works
Explanation: Each condition looks at the start of the code with LEFT. TRUE at the end catches all the other codes.
Syntax: =IFS(LEFT(A2,2)="HR","Human Resources",LEFT(A2,3)="FIN","Finance",LEFT(A2,3)="ENG","Engineering",TRUE,"Other")
HR-1 gives Human Resources. FIN-2 gives Finance. ENG-3 gives Engineering. OPS-4 matches none, so Other.
Try it yourself in the live sheet
Type your formula in the highlighted cell and get instant feedback. Free, no Excel install needed.
Try this question in the live sheet →IFS syntax
Checks multiple conditions in order and returns the value for the first one that's true. IFS is used to build decision rules directly into a spreadsheet instead of manually judging each row. Full IFS guide.
More IFS practice questions
- Write A for marks 90 or more, B for 60 or more, otherwise C. Put the grade in C2 to C4.
- Write Absent if the marks cell is empty, Pass if the marks are 40 or more, otherwise…
- Work out the commission: 10% of the sales if they are 100000 or more, 5% if they are…
- Find the shipping charge by weight: up to 1 kg is 40, up to 5 kg is 90, up to 10 kg is…
- Rate each student on two marks: Star if both are 90 or more, Good if at least one is 90…
- Find the amount (quantity times price) with a discount on the whole amount: 20% off for…
- Write the quarter for each month name: Jan to Mar is Q1, Apr to Jun is Q2, Jul to Sep is…
- Scores are in B2:B7. Grade them in D2:D7: 90 and above is A, 75 and above is B, 60 and…
All practice questions · Excel exercises · Interview prep · Cheat sheet