EXCEL Calculate if cell is not empty

Solved
TITI66MATH Posted messages 5 Status Membre -  
 xx -
Hello,

I would like to subtract two dates only if the cells are not empty.
If one cell is empty, I would like to get an empty cell as a result.

The formula I am using is =NETWORKDAYS(A1,A2)

For example, in A1 I have 10/03/13 and in A2 I have 10/05/13, in A3 I get 2.
If in A1 I have 10/03/13 but A2 is empty, I would like to have an empty cell.

Thank you in advance for your responses.

3 réponses

PHILOU10120 Posted messages 6463 Registration date   Status Contributeur Last intervention   833
 
Hello

a solution

=IF(OR(A1="";A2="");"";NETWORKDAYS(A1;A2)) 


6
TITI66MATH Posted messages 5 Status Membre
 
Thank you very much.
Your formula works great.

However, I would also like the calculation not to be performed if the date contains the letter A.

Example: in A1 I have 10/12/13 and in B1 I have 12/12/13A. I would like to have an empty cell in C1 as a result.

Thank you.
0
TITI66MATH Posted messages 5 Status Membre
 
Thank you all for your responses.
0