๐๐ป๐๐ฒ๐ฟ๐๐ถ๐ฒ๐๐ฒ๐ฟ: 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!