I have a spreadsheet with two formulas which need to allow for a variable number of rows to calculate. My original solution to this problem does work however it will not work if there are blank rows in the data.
Formula: (CSE)
This is the original formula, the highlighted sections would need to manually updated in order for the formula to return an accurate result when the data set size changes
=SUM(IFERROR(N(FREQUENCY(ABS($K$2:$K$45),ABS($K$2:$K$45))>0)*N($I$2:$I$45<DATE(YEAR($M$2),MONTH($M$2)+1,1))*N($I$2:$I$45>=DATE(YEAR($M$2),MONTH($M$2),1)),""))
Highlighted is what I tried to allow for an automatic update.
=SUM(IFERROR(N(FREQUENCY(ABS(OFFSET(K2,,,COUNTA(K:K))),ABS(OFFSET(K2,,,COUNTA(K:K))))>0)*N(OFFSET(I2,,,COUNTA(I:I))<DATE(YEAR($M$2),MONTH($M$2)+1,1))*N(OFFSET(I2,,,COUNTA(I:I))>=DATE(YEAR($M$2),MONTH($M$2),1)),""))
This works fine, but it does not capture the number of bottom rows equivalent to the number of blanks - 1 (4 blanks in the data will give a range 3 rows short of the bottom)
More details and sample data in the attached file. See Green Comments in the file. Red Cells on the bottom of I, J, K, are being ignored by my formula in O11, and P11. EDIT: It is the bottom THREE red cells, I had 4 highlighted in the sheet by accident.
Thanks
xf091214.xlsx
Bookmarks