'Blank output if either of the two cells referenced in the formula are missing

I have a simple spreadsheet that includes an individual's date of birth and in the same row in an adjacent column I have the date of death. I have a fornula that calculates the age of the person at death : =DATEDIF(D7,E7,"Y"). this formula works great but I would like the output of the formula to be blank if either of the cells referenced in the formula are blank.

for example I have an individual that is missing the birthdate but she died in 2000, when Excel calculates the age the result is 100 years old since, I assume, it defauilts to the year 1900 as the birthdate.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source