vladimiratanasiu
Active Member
- Joined
- Dec 17, 2010
- Messages
- 348
- Office Version
- 365
- 2021
- Platform
- Windows
Hello!
I posted a message some time ago (Formula to calculate automatically progressive average), getting the proper solution in that case. Basically, it calculates and shows automatically the average of all costs at some point, each time a new value is inserted and excluding the annual totals. Presently, some changes have occured, needing to adjust the old formula to the new conditions. In the attached table, the column D includes cells to show monthly energy consumption. Some cells contains non-zero values (e.g. D2:D12, D15:D19 etc.), but other ones are blank (e.g. D13, D20:D21 etc.). In column F, it's calculated the medium energy consumption, as dynamic average of all values recorded at some point. However, the formula considers only non-zero cells (see results from F13, F20:F21, F28:F29 etc.), ignoring the blank ones. I need it to be adjusted, so that can count also the blank cells, generating in column F the average values from the column J. As it's seen, the range J2:J11 has identical values with those from D2:D11, but starting with J13 there are constant differences between the cells of the two columns because of the blank cells from column D. In addition, I need the formula to take into consideration all cells after the last non-zero one (e.g. F43:F52), so that they can be blank and not show average values calculated on the basis of the according range of column D (D43:D52).
Thank you!
I posted a message some time ago (Formula to calculate automatically progressive average), getting the proper solution in that case. Basically, it calculates and shows automatically the average of all costs at some point, each time a new value is inserted and excluding the annual totals. Presently, some changes have occured, needing to adjust the old formula to the new conditions. In the attached table, the column D includes cells to show monthly energy consumption. Some cells contains non-zero values (e.g. D2:D12, D15:D19 etc.), but other ones are blank (e.g. D13, D20:D21 etc.). In column F, it's calculated the medium energy consumption, as dynamic average of all values recorded at some point. However, the formula considers only non-zero cells (see results from F13, F20:F21, F28:F29 etc.), ignoring the blank ones. I need it to be adjusted, so that can count also the blank cells, generating in column F the average values from the column J. As it's seen, the range J2:J11 has identical values with those from D2:D11, but starting with J13 there are constant differences between the cells of the two columns because of the blank cells from column D. In addition, I need the formula to take into consideration all cells after the last non-zero one (e.g. F43:F52), so that they can be blank and not show average values calculated on the basis of the according range of column D (D43:D52).
Thank you!
Cell Formulas | ||
---|---|---|
Range | Formula | |
C2:C13 | C2 | ='Costuri energie generale'!P38 |
C15:C26 | C15 | ='Costuri energie generale'!P55 |
C28:C39 | C28 | ='Costuri energie generale'!P74 |
C41:C52 | C41 | ='Costuri energie generale'!P93 |
F2:F52 | F2 | =IF((C2="total"),"",AVERAGEIFS($D$2:D2,$C$2:C2,"<>"&"Total")) |
D2:D13 | D2 | =IF(ISBLANK('Costuri energie generale'!Q38),"",'Costuri energie generale'!Q38) |
D14,D53,D40,D27 | D14 | =SUM(D2:D13) |
D15:D26 | D15 | =IF(ISBLANK('Costuri energie generale'!Q55),"",'Costuri energie generale'!Q55) |
D28:D39 | D28 | =IF(ISBLANK('Costuri energie generale'!Q74),"",'Costuri energie generale'!Q74) |
D41:D52 | D41 | =IF(ISBLANK('Costuri energie generale'!Q93),"",'Costuri energie generale'!Q93) |
Last edited: