Leaving a Cell Blank if one value of the formula is blank

[Closed]
Report
Posts
1
Registration date
Saturday November 10, 2012
Status
Member
Last seen
November 10, 2012
-
Posts
3
Registration date
Wednesday November 21, 2012
Status
Member
Last seen
November 23, 2012
-
Hello,

I was making a template to be distributed to multiple receivers. Since the template is blank and must automatically count the number of days an employee has been around since the date of employment, i could not find the right formula where the cell with the difference between two dates will appear blank if one of the cell is blank.

Please see the example below:
- A1 = to the hire date of the employee
- A2 = automatically computes for the days of tenure with this formula: (TODAY())-A1

The problem is if cell A1 is blank, A2 will show 41223. This is a file template that needs to be sent and A1 should be left blank for the receiver to fill with the appropriate information.

I hope someone could give me the right formula to this.

2 replies

Posts
7098
Registration date
Saturday April 7, 2007
Status
Moderator
Last seen
June 10, 2021
488
Hi,

Try this formula :
= IF(A1="",""),TODAY()-A1)

Regards
Posts
3
Registration date
Wednesday November 21, 2012
Status
Member
Last seen
November 23, 2012

This is the exact function you need:
=IF(A1="","",(TODAY())-A1)
It should work perfectly!