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

Closed
peckman Posts 1 Registration date Saturday 10 November 2012 Status Member Last seen 10 November 2012 - 10 Nov 2012 à 00:27
MelyElly Posts 3 Registration date Wednesday 21 November 2012 Status Member Last seen 23 November 2012 - 21 Nov 2012 à 20:07
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 responses

aquarelle Posts 7181 Registration date Saturday 7 April 2007 Status Moderator Last seen 14 February 2026 491
10 Nov 2012 à 12:05
Hi,

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

Regards
MelyElly Posts 3 Registration date Wednesday 21 November 2012 Status Member Last seen 23 November 2012
21 Nov 2012 à 20:07
This is the exact function you need:
=IF(A1="","",(TODAY())-A1)
It should work perfectly!