Drag a formula down with Row changes by another interval other than one

前端 未结 1 873
孤街浪徒
孤街浪徒 2020-12-11 20:37

I have been trying to figure this out for hours now. I have this formula:

 =PROMEDIO.SI.CONJUNTO(Flankers!C15:C54;Flankers!D15:D54;1)

I hav

相关标签:
1条回答
  • 2020-12-11 21:23

    Almost marked this as a duplicate of Duplicated cells skip 10 rows but in fact it is the reverse of it. However, the solution is the same. Use the INDEX function with a little maths to achieve the stagger.

    The easiest way to do this is with the OFFSET function but that function is considered volatile¹ and will recalulate whenever anything in the workbook changes. Large numbers of these will result in calculation lag everytime something is typed into any cell.

    With the volatile¹ OFFSET,

    =AVERAGEIFS(OFFSET(Flankers!$C$15, (ROW(1:1)-1)*93, 0, 40, 1),
                OFFSET(Flankers!$C$15, (ROW(1:1)-1)*93, 1, 40, 1), 1)
    

    With the non-volatile INDEX,

    =AVERAGEIFS(INDEX(Flankers!C:C, 15+(ROW(1:1)-1)*93):INDEX(Flankers!C:C, 54+(ROW(1:1)-1)*93),
                INDEX(Flankers!D:D, 15+(ROW(1:1)-1)*93):INDEX(Flankers!D:D, 54+(ROW(1:1)-1)*93), 1)
    

    The second formula may look more complicated but all it really does is provide a starting cell and and ending cell for each range in the AVERAGEIFS function. INDEX references the entire column and some basic maths do the rest.

    In ES-ES formula language (with semicolon list separators) as,

    =PROMEDIO.SI.CONJUNTO(DESREF(Flankers!$C$15; (FILA(1:1)-1)*93; 0; 40; 1);
                          DESREF(Flankers!$C$15; (FILA(1:1)-1)*93; 1; 40; 1); 1)
    
    =PROMEDIO.SI.CONJUNTO(INDICE(Flankers!C:C; 15+(FILA(1:1)-1)*93):INDICE(Flankers!C:C; 54+(FILA(1:1)-1)*93);
                          INDICE(Flankers!D:D; 15+(FILA(1:1)-1)*93):INDICE(Flankers!D:D; 54+(FILA(1:1)-1)*93); 1)
    

    ¹ Volatile functions recalculate whenever anything in the entire workbook changes, not just when something that affects their outcome changes. Examples of volatile functions are INDIRECT, OFFSET, TODAY, NOW, RAND and RANDBETWEEN. Some sub-functions of the CELL and INFO worksheet functions will make them volatile as well.

    0 讨论(0)
提交回复
热议问题