TGViewer
MS Excel for Data Analysis MS Excel for Data Analysis @excel_analyst ยท 73.3K subscribers
Post #1819 11.2K
โœ… 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):
=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!
  • โค 26
  • ๐Ÿ‘ 6
  • ๐Ÿ”ฅ 2
More from @excel_analyst
  1. Oct 18, 2026๐Ÿฐ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€ ๐—ง๐—ผ ๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—–๐—ผ๐—ฑ๐—ถ๐—ป๐—ด ๐—™๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜๐Ÿ˜ โœ… 100% FREE Yoโ€ฆ
  2. Oct 18, 2026For large or recurring comparisons, Power Query can be a better approach. ๐Ÿ”Ÿ A formula isโ€ฆ
  3. Oct 18, 2026๐Ÿ“Š Excel Interview Questions โ€” Part 4 This part focuses on advanced formulas, dynamic arraโ€ฆ
  4. Oct 17, 2026This is a practical example of combining IF, AND, and date functions. ๐Ÿ”Ÿ You receive a mesโ€ฆ
  5. Oct 17, 2026๐Ÿ“Š Excel Interview Questions โ€” Part 3 This part focuses on Power Query, PivotTables, chartโ€ฆ
  6. Oct 17, 2026๐—œ๐—•๐—  ๐—™๐—ฅ๐—˜๐—˜ ๐—ง๐—˜๐—–๐—› ๐—–๐—ข๐—จ๐—ฅ๐—ฆ๐—˜๐—ฆ ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ! ๐ŸŽ“ Explore IBM Cognitive Class and buildโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’