今天记录一个TEXT函数按条件求和的例子。先上公式:
B2=SUMPRODUCT(TEXT(TODAY()-TEXT($D$21:$D$116,"0-00-00;;;!0"),"["&LEFTB(B$1,5)&"]1;!0")*($B$21:$B$116=$A2)*$C$21:$C$116)
B2=SUMPRODUCT(TEXT(TODAY()-TEXT($D$21:$D$116,"0-00-00;;;!0"),"["&LEFTB(B$1,5)&"]1;!0")*($B$21:$B$116=$A2)*$C$21:$C$116)