八进制到二进制数为12位数 [英] octal to binary for 12 digit numbers in excel

查看:193
本文介绍了八进制到二进制数为12位数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将一个12位的八进制数转换为二进制

I am trying to convert a 12 digit octal number to binary

但是看起来像excel的内置函数OCT2Bin不适用于大于517的数字

But looks like excel's inbuilt function OCT2Bin wont work for numbers greater than 517

所以我试图拆分数字并连接它们,但是没有工作

So I tried to split the numbers and concatenate them, but it didn't work

我尝试过

=OCT2BIN(MID(A2,1,2))&OCT2BIN(MID(A2,3,2))&OCT2BIN(MID(A2,5,2))&OCT2BIN(MID(A2,7,2))&OCT2BIN(MID(A2,9,2))&OCT2BIN(MID(A2,11,2))

例如数字的八进制到二进制

For example Octal to binary of the number

123456765432 

1010011100101110111110101100011010

但我的公式正在返回

101011100101110111110101100110100

明白这个公式是不行的,因为我不应该打破数字并连接它们。但我不知道如何处理它在excel中

I understand that the formula is not working because I shouldn't be breaking the numbers and concatenate them. But I am not sure how to handle it in excel

有没有办法将12位八进制数转换成二进制?

is there a way to convert 12 digit octal numbers to binary?

推荐答案

连接函数是没有问题的,因为八进制数中的每个数字都代表三位数。
你的问题是省略前导零,例如在您的示例中,您的示例中是34o = 011100,但是不返回第一个0,因此您只能连接11100. OCT2BIN函数有另一个参数,您可以在其中确定返回的位数:

Concatenating the function is no problem because every digit in an octal number represents exactly 3 digits in binary. Your problem is that leading zeros are omitted, e.g. in your example 34o = 011100 but the first 0 is not returned so you only concatenate 11100. The OCT2BIN function has another argument in which you can determine the number of digits returned:

OCT2BIN(34) = 11100
OCT2BIN(34, 6) = 011100

性能:您可以一次转换3个八进制数字,而不是仅转换2个。

As of performance: you can convert 3 octal digits at once instead of only 2.

这篇关于八进制到二进制数为12位数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆