Thursday, February 2, 2023

Calculate Age With Date, Date IF Formula in MS Excel

Calculate Age With Date, Date IF Formula

In Microsoft Excel, you can calculate age using a formula that subtracts the birthdate from the current date or a specified date. Here's an example using the TODAY() function to determine age based on the current date:
scss
=TODAY()-birthdate
Replace "birthdate" with the cell reference containing the person's birthdate. The result will be the number of days between the birthdate and today, so you'll need to format the cell to display the result as years.

You can also use an IF formula to display different results based on the age calculated. For example, to display "Adult" if the person is 18 or older and "Minor" if they're under 18, use this formula:
less
=IF(TODAY()-birthdate >=365.25*18, "Adult", "Minor")

Note: 365.25 is used to account for leap years.

No comments:

Post a Comment

यह तन विष की बेलरी, गुरु अमृत की खान। शीश दियो जो गुरु मिले, तो भी सस्ता जान।। इसका अर्थ?

 यह दोहा संत कबीरदास जी का है और इसका अर्थ बहुत ही गहरा और प्रेरणादायक है: दोहा: "यह तन विष की बेलरी, गुरु अमृत की खान। शीश दियो जो...