# If then formula for a blank cell

#### AJSIV4

##### New Member
I have been looking for a formula that will produce a blank cell under certain circumstances. I have found some formulas for this, but not to the level of detail I need it. I've tried "ISBLANK, "SUMIF" and "IF" and I'm stuck.

I need D1 to produce a blank cell if A1 and B1 and C1 are blank. If there is at least one value in A1 or B1 or C1 then I want D1 to produce the sum of A1:C1.

Any help would be great. Thanks.

### Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

#### GRTorres

##### Active Member
Hello AJSIV4, welcome to the board.

try this

Code:
``D1  =IF(AND(A1 = "", B1 = "", C1 = ""), "", SUM(A1:C1))``

#### AJSIV4

##### New Member
I am still getting 0.00 even with all cells blank. Does it have to do with the cell being formatted as #.##? Here is the actual formula I'm using with the info you gave me above.

Cell H6 contains:
=IF(AND(A6="",B6="",C6="",D6="",E6="",F6="",G6="",),"",SUM(A6:E6))

#### FormR

##### MrExcel MVP
I am still getting 0.00 even with all cells blank. Does it have to do with the cell being formatted as #.##? Here is the actual formula I'm using with the info you gave me above.

Cell H6 contains:
=IF(AND(A6="",B6="",C6="",D6="",E6="",F6="",G6="",),"",SUM(A6:E6))
You have an extra comma - try deleting it.

Or give this a try:
=IF(COUNTA(A6:G6)=0,"",SUM(A6:E6))

##### MrExcel MVP
I am still getting 0.00 even with all cells blank. Does it have to do with the cell being formatted as #.##? Here is the actual formula I'm using with the info you gave me above.

Cell H6 contains:
=IF(AND(A6="",B6="",C6="",D6="",E6="",F6="",G6="",),"",SUM(A6:E6))
Also...

=IF(COUNT(A6:G6)=COLUMNS(A6:G6),SUM(A6:G6),"")

#### AJSIV4

##### New Member
Deleting the extra comma did the trick! Thank you so much!!