Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Formula cell blank if the two input cells are empty.

0

Hello, making a simple check register.  I would like the balance cell to be empty if the payment & credit cells are empty.  When I copied the formula down the balance column all the cells are filled with the last value derived by the formula. =F2-D3+E3.  Like I said VERY simple. thanks for any assistance.

Answer
Discuss

Answers

0

You might try something like this:

=IF(COUNT(D3:E3),F2-D3+E3,"")

COUNT(D3:E3) returns 0 if both cells are blank in which case the formula writes a null string.

For some reason I don't recall I found this unsuitable in a project I did a while ago and I opted for conditional formatting. Say, the balance is in column F, apply a condition like =F3=F2 and format the font colour as white (same as cell background). The balance would still be in the cell and can be used for further calculations on the right but it would be invisible.

The drawback of this method might be that the font color is also changed when two susequent cells are blank. If necessary the formula might be expanded to check for blanks.

Discuss

Discussion

It works, thanks much!
exceldummy May 14, '19 at 6:09 pm
Great! Please mark my answer as "Selected".
Variatus (rep: 4889) May 14, '19 at 11:29 pm
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login