๐๐ป๐๐ฒ๐ฟ๐๐ถ๐ฒ๐๐ฒ๐ฟ:
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!
Post #2986
5.69K
- โค 19
- ๐ฅฐ 3