Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If 1 or 2 cells are blank then

Tags:

excel

I'm trying to write a simple formula to check whether either 1 or both cells are blank and, if so, leave the resulting cell blank. I want the resulting cell to only display a calculation if both cells are filled in.

I've got this do far though it doesn't work as I wanted: =IF(OR(C4<>"",B4<>""),A4-C4,"")

b4 has a date and c4 has a numeric value (4). the formulate is in d4. I want to check if b4 or c4 are blank and, if so, leave d4 blank too, else take c4 from a4 (14 as of now).

like image 491
MBell33 Avatar asked Dec 12 '14 08:12

MBell33


1 Answers

It should work:

=IF(ISBLANK(C4);"";IF(ISBLANK(D4);"";A4-C4))

It checks if C4 is a blank cell, if not then checks if D4 is blank, if not then does the math.

like image 157
jcbermu Avatar answered Nov 23 '22 11:11

jcbermu