✅ Excel Interview Mini-Challenge! 📊💼
𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄𝗲𝗿: How would you fetch the department name for each employee using Excel? Some employees may not be assigned a department.
𝗠𝗲: I'd use VLOOKUP or XLOOKUP depending on the Excel version.
🔹 Using XLOOKUP (recommended for modern Excel):
– A2: Employee's department ID
– Departments!A:A: Column with department IDs
– Departments!B:B: Column with department names
– "No Department": Shown if no match found
✔ Why it works:
– XLOOKUP returns department names while handling missing matches gracefully.
– Cleaner and more flexible than older functions.
🔎 Bonus Insight:
Older Excel? Use VLOOKUP with IFERROR:
💬 Tap ❤️ for more!
𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄𝗲𝗿: How would you fetch the department name for each employee using Excel? Some employees may not be assigned a department.
𝗠𝗲: I'd use VLOOKUP or XLOOKUP depending on the Excel version.
🔹 Using XLOOKUP (recommended for modern Excel):
=XLOOKUP(A2, Departments!A:A, Departments!B:B, "No Department") – A2: Employee's department ID
– Departments!A:A: Column with department IDs
– Departments!B:B: Column with department names
– "No Department": Shown if no match found
✔ Why it works:
– XLOOKUP returns department names while handling missing matches gracefully.
– Cleaner and more flexible than older functions.
🔎 Bonus Insight:
Older Excel? Use VLOOKUP with IFERROR:
=IFERROR(VLOOKUP(A2, Departments!A:B, 2, FALSE), "No Department")💬 Tap ❤️ for more!
❤17👍3🔥2