基于数字的数字进行舍入

时间:2017-07-05 09:57:53

标签: excel

我有以下Excel电子表格:

         A                 B           
1        6.355            6.000     
2       58.690           50.000
3      357.867          350.000
4    1.260.563        1.200.000
5   12.480.370       12.400.000

A栏中,我有一堆镭编号,每当用户将新数据输入电子表格时,这些编号都会发生变化。

B栏中,我想在以下系统中对 A列中的数字进行CUT和ROUNDDOWN:

Number consists of 4 digits  -->  CUT and ROUNDDOWN after the 1st digit
Number consitst of 5 digits  -->  CUT and ROUNDDOWN after the 1st digit
Number consists of 6 digits  -->  CUT and ROUNDDOWN after the 2nd digit
Number consists of 7 digits  -->  CUT and ROUNDDOWN after the 2nd digit
Number consists of 8 digits  -->  CUT and ROUNDDOWN after the 3rd digit

到目前为止,我已尝试过以下内容:

=ROUNDDOWN(A1,1-LEN(A1))

但是,此公式仅适用于4-5位数字。之后我必须将 1 更改为 2 ,依此类推。

有没有办法根据上述系统自动舍入?

1 个答案:

答案 0 :(得分:0)

将以下公式放在B1向下:

=ROUNDDOWN(A1,-(INT(LOG10(A1)/2)+2))