Q:

Nested Ifs for personal accounting sheet

I have a personal accounting sheet with 5 columns. C is Debit, D is Credit and E is Balance. I want to do 3 things but I've been confusing myself for the past hour.
If C5 and D5 are both blank, return blank in E5.
If C5 contains a number, subtract C5 from E4 and show value in E5
If D5 contains a number, add it to E4 and show value in E5

A:

The formula is: =IF(COUNT(C5:D5)=0,"",IF(ISNUMBER(C5),E4-C5,E4+D5))
It does only the subtraction even if both C5 and D5 contains numbers, as you wrote in your question.

