-
All replies
-
Helpful answers
-
Sep 23, 2016 3:32 PM in response to Scott Fby Barry,Hi Scott,
So with expenses totalling 766.64, and revenue totalling 27, your profit for September 28 is $793.74. Wow!
But your question is specifically about the calculations in row 8, showing YTD profit.
My assumption is that you want a running total, with each cell in Row 8 showing the total of all cells in row 7 up to and including the current column.
Using the + operator will not work, because + will throw an error if presented with text values.
SUM(), though, treats text as having a numerical value of zero.
Here are two examples, both using SUM Both skip column A in their calculations:
B8 uses this basic formula:
B8: =SUM($B7:B7)
Filled right, the first B7, set to Preserve column by the $ operator, remains pointed to B7, while the second B7, a relative reeference, increments by one column for each column filled right to remain pointed at the cell above the one containing that copy of the formula. Results are seen in row 8 (yellow fill).
B9 uses the same basic formula, wrapped in an IF statement that acts as a switch, substituting a null string ( "" ) for the calculation result when the cell in row 7 does not contain an entry.
B9: =IF(LEN(B7)<1,"",SUM($B7:B7))
Since the 'empty' cell result shown in row 9 (green fill) will only appear when the content of the cell in row 7 displays less than one character, it requires those cells to display no characters until their formula has data to work with, OR it requires a different test to determine whether the YTD amount should be displayed. Other tests may be used, either in the YTD calculation or in the Profit calculation to control this, but determining the best one to use requires more detail from you.
Regards,
Barry

