COUNTBLANK
tells you how many cells are unfilled or set to '. IF
lets you conditionally do one of two things based on whether the first statement is true or false. The second comma separated argument is what to do if it's true, the third comma separated argument is what to do if it's false.<>
means 'not equal to'.F16:G16
(your credit and debit cells) is not 2, which means both aren't blank, then calculate the equation you provided in your question. Otherwise set the cell to blank('
).H16
, it will update the row references so the proper rows for the credit and debit amounts are looked at. H15
, would report blank, which is treated like a 0 in this case.