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

Closed
peckman Posts 1 Registration date Saturday November 10, 2012 Status Member Last seen November 10, 2012 - Nov 10, 2012 at 12:27 AM
MelyElly Posts 3 Registration date Wednesday November 21, 2012 Status Member Last seen November 23, 2012 - Nov 21, 2012 at 08:07 PM
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 7140 Registration date Saturday April 7, 2007 Status Moderator Last seen March 25, 2024 491
Nov 10, 2012 at 12:05 PM
Hi,

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

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