๐๐ป๐๐ฒ๐ฟ๐๐ถ๐ฒ๐๐ฒ๐ฟ:
You have 2 minutes to solve this Excel problem.
You have the following data:
Employee | Department | Salary
John | IT | 75,000
Sarah | HR | 60,000
Mike | IT | 82,000
David | Finance | 90,000
Alice | HR | 65,000
How would you count the number of unique departments?
๐ ๐ฒ: Challenge accepted! ๐ช
=COUNTA(UNIQUE(B2:B6))
๐ก Explanation:
The UNIQUE() function extracts distinct department names, and COUNTA() counts how many unique values are returned.
UNIQUE(B2:B6) returns: IT, HR, Finance.
COUNTA() counts these unique values.
The result is the total number of unique departments.
This challenge tests your understanding of: โ
UNIQUE()
โ
COUNTA()
โ
Dynamic Arrays
โ
Data Analysis
๐ฏ Expected Output Example
Formula | Result
=COUNTA(UNIQUE(B2:B6)) | 3
(The unique departments are IT, HR, and Finance.)
๐ Bonus (For Older Excel Versions)
=SUMPRODUCT((B2:B6<>"")/COUNTIF(B2:B6,B2:B6))
This formula counts unique values without using the UNIQUE() function, making it compatible with older versions of Excel.
๐ Tip for Excel Job Seekers:
Modern Excel functions are becoming increasingly common in interviews. Be familiar with:
UNIQUE()
FILTER()
SORT()
SEQUENCE()
TEXTSPLIT()
These dynamic array functions simplify complex formulas and are widely used in Microsoft 365.
โค๏ธ React with โค๏ธ for more Excel interview challenges!
Post #2980
5.58K
- โค 17