How do you calculate income and expense ,where the income is one color and the expense is red in the same colum?
How do you calculate income and expense ,where the income is one color and the expense is red in the same colum?
Hi Jentz
If the expense figures are red due to the cell format (so expenses appear as red though if you look at the cell, it's a negative number and says - 1.50 say, but positive values are automatic/black), then you can use the worksheet function SUMIF as follows:
If you want to sum the red (negative) numbers in the range B2:B15 (you should change this in your formula), use this:
=SUMIF(B2:B15,"<0")
That adds any number which is less than 0. It may appear as a negative number (say -123.45) but you can use Home/Format Paster to format it the same as one of the red expense cells.
To sum the black (positive numbers), use this:
=SUMIF(B2:B15,">=0")
That adds numbers which are equal to or greater than zero (so income).
If you want to check this, then put =SUM(B2:B18) in another cell; the black SUMIF number less the red SUMIF number should equal that SUM.
If the numbers aren't red through normal formatting (seems unlikely), then a VBA solution would be needed (e.g. a User Defined Function)