TGViewer
Data Analytics Data Analytics @sqlspecialist ยท 111K subscribers
Post #2986 5.69K
๐—œ๐—ป๐˜๐—ฒ๐—ฟ๐˜ƒ๐—ถ๐—ฒ๐˜„๐—ฒ๐—ฟ:
You have 2 minutes to solve this Excel problem.

You have the following data:

Employee: Joining Date
John: 15-Jan-2022
Sarah: 20-Mar-2021
Mike: 10-Jul-2023
David: 05-Nov-2020

How would you calculate the number of years each employee has worked in the company?

๐— ๐—ฒ: Challenge accepted! ๐Ÿ’ช

Formula:
=DATEDIF(B2,TODAY(),"Y")

๐Ÿ’ก Explanation:
The DATEDIF() function calculates the difference between two dates.
B2 is the employee's joining date.
TODAY() returns the current date.
"Y" returns the number of completed years between the two dates.

Copy the formula down to calculate the years of service for all employees.

This challenge tests your understanding of:
โœ… DATEDIF()
โœ… TODAY()
โœ… Date Functions
โœ… Employee Tenure Calculation

๐ŸŽฏ Expected Output Example

Employee: Joining Date: Years of Service
John: 15-Jan-2022: 4
Sarah: 20-Mar-2021: 5
Mike: 10-Jul-2023: 3
David: 05-Nov-2020: 5

Results will change automatically as time passes because TODAY() is dynamic.

๐Ÿš€ Bonus: Calculate Complete Years and Months
=DATEDIF(B2,TODAY(),"Y")&" Years "&DATEDIF(B2,TODAY(),"YM")&" Months"

Example Output:
4 Years 6 Months
2 Years 3 Months

๐Ÿš€ Tip for Excel Job Seekers:
Date functions are commonly asked in Excel interviews. Make sure you're comfortable with:
TODAY(), NOW(), DATEDIF(), EDATE(), EOMONTH(), YEAR(), MONTH(), DAY()

These functions are widely used in HR, finance, payroll, and reporting.

โค๏ธ React with โค๏ธ for more Excel interview challenges!
  • โค 19
  • ๐Ÿฅฐ 3
More from @sqlspecialist
  1. Oct 7, 2026๐Ÿ“Š Kandinsky 6.0 Video: AI-Powered Content Creation for Analysts The new Kandinsky 6.0 Vidโ€ฆ
  2. Oct 7, 2026Alternatively, depending on the Excel version and requirement, I could use functions suchโ€ฆ
  3. Oct 7, 2026๐Ÿ“Š Data Analyst Interview Series โ€” Part 5 Guys, let's continue our Data Analyst Interviewโ€ฆ
  4. Oct 7, 2026๐Ÿš€๐—ฃ๐—ฎ๐˜† ๐—”๐—ณ๐˜๐—ฒ๐—ฟ ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ง๐—ฟ๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด | ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ ๐—ฎ ๐—™๐˜‚๐—น๐—น๐˜€๐˜๐—ฎ๐—ฐโ€ฆ
  5. Oct 7, 2026๐Ÿ”Ÿ What is the difference between UNION and JOIN? Sample Answer: "JOIN combines columns frโ€ฆ
  6. Oct 7, 2026๐Ÿ“Š Data Analyst Interview Series โ€” Part 4 Guys, let's continue our Data Analyst Interviewโ€ฆ
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 โ†’