Sum column if cells are outside range (range = leftmost value in row + next 11 columns) R or Excel?

前端 未结 2 1798
礼貌的吻别
礼貌的吻别 2021-01-27 19:21

Please see the picture. In the matrix pictured, an entry is considered \"New Business\" from the leftmost value + the next 11 columns (so 12 months total). I\'ve highlighted thi

2条回答
  •  长发绾君心
    2021-01-27 20:06

    I added a helper column C that finds the first non blank in the row (my data went from column D to column AZ)

    =MATCH(TRUE,INDEX((D2:AZ2<>0),0),0)
    

    This was then the formula I put in cell D5 and copied it across

    =SUMIFS(D2:D4,$C2:$C4,">"&COLUMN(D1)-12-3)
    

    The 12 is for 12 months and the 3 is for Column C where the data starts.

    The return business is in D6 and across

    =SUM(D2:D4)-D5
    

    My Results

提交回复
热议问题