本文介绍了Excel中大数字的十进制到二进制转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很大的数字在excel表,我想把它们转换成二进制例如
12345678
965321458
-12457896
有人可以帮助我如何做到这一点。
谢谢。

解决方案

如果我们在 0 2 ^ 32-1 可以使用以下公式:

  = DEC2BIN(MOD(QUOTIENT($ A $ 1256 ^ 3),256),8)及DEC2BIN(MOD(QUOTIENT($ A $ 1256 ^ 2),256),8)及DEC2BIN(MOD(QUOTIENT($ A $ 1,256 ^ 1),256),8)&DEC2BIN(MOD(QUOTIENT($ A $ 1,256 ^ 0),256),8)

注意: = DEC2BIN()函数不能处理大于511的数字,以便您看到我的公式打破了数字转换成四个8位块,将其转换为二进制格式,然后连接结果。



理论上,您可以将此公式扩展到六个8位块。 Excel中可以获得的最大精度为十五位十五进制数。当超出时,只剩下最显着的15位数字,剩下的是四舍五入。即如果您键入 12345678901234567 Excel将其存储为 12345678901234500 。所以因为 2 ^ 48-1 是15位十进制数字长,数字将不会四舍五入。


I have some large number in an excel sheet and i want to convert them to binary eg 12345678 965321458 -12457896 Could someone help me how to do this. Thanks.

解决方案

If we are talking positive number between 0 and 2^32-1 you can use this formula:

=DEC2BIN(MOD(QUOTIENT($A$1,256^3),256),8)&DEC2BIN(MOD(QUOTIENT($A$1,256^2),256),8)&DEC2BIN(MOD(QUOTIENT($A$1,256^1),256),8)&DEC2BIN(MOD(QUOTIENT($A$1,256^0),256),8)

NOTE: =DEC2BIN() function cannot handle numbers larger than 511 so as you see my formula breaks your number into four 8-bit chunks, converts them to binary format and then concatenates the results.

Well, theoretically you can extend this formula up to six 8-bit chunks. Maximum precision you can get in Excel is 15 (fifteen) decimal digits. When exceeded, only the most significant 15 digits remain, the rest is rounded. I.e. if you type 12345678901234567 Excel will store it as 12345678901234500. So since 2^48-1 is 15 decimal digits long the number won't get rounded.

这篇关于Excel中大数字的十进制到二进制转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 06:10