如何将公式校正为对KB,MB,GB,TB等所有单位都是动态的...它完全适用于MB和GB,但不适用于其他单位。我的公式是:
{=IF(SUM(IF(ISNUMBER(VALUE(LEFT(A1:A10,LEN(A1:A10)-3))+0),VALUE(LEFT(A1:A10,LEN(A1:A10)-3))+0))>=1000,TEXT(SUM(IF(ISNUMBER(VALUE(LEFT(A1:A10,LEN(A1:A10)-3))+0),VALUE(LEFT(A1:A10,LEN(A1:A10)-3))+0))/1024,"0.00")&" GB",TEXT(SUM(IF(ISNUMBER(VALUE(LEFT(A1:A10,LEN(A1:A10)-3))+0),VALUE(LEFT(A1:A10,LEN(A1:A10)-3))+0)),"0.00")&" MB")}
答案 0 :(得分:0)
我是这样做的,对我来说很好。
{=TEXT(SUM(NUMBERVALUE(LEFT(A1:A4,FIND(" ",A1:A4,1)-1))*IF(RIGHT(A1:A4,2)="KB",1/1000000,IF(RIGHT(A1:A4,2)="MB",1/1000,IF(RIGHT(A1:A4,2)="GB",1,IF(RIGHT(A1:A4,2)="TB",1000,IF(RIGHT(A1:A4,2)="PB",1000000,0)))))),"0,00") & " GB"}
答案 1 :(得分:0)
使用:
=ROUND(SUMPRODUCT(LEFT(A1:A4,FIND(" ",A1:A4)-1)*10^(MATCH(RIGHT(A1:A4,2),{"KB","MB","GB","TB"},0)*3))/(10^(INT((LEN(SUMPRODUCT(LEFT(A1:A4,FIND(" ",A1:A4)-1)*10^(MATCH(RIGHT(A1:A4,2),{"KB","MB","GB","TB"},0)*3)))-1)/3)*3)),2) & " " & INDEX({"KB","MB","GB","TB"},INT((LEN(SUMPRODUCT(LEFT(A1:A4,FIND(" ",A1:A4)-1)*10^(MATCH(RIGHT(A1:A4,2),{"KB","MB","GB","TB"},0)*3)))-1)/3))