Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Converting to Octal.

Converting to Octal

Written by Allen Wyatt (last updated July 28, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


1

There are four types of numbering systems commonly used in programming: binary, octal, decimal, and hexadecimal. Each is simply a different method of expressing the exact same values. Excel makes it easy to convert between decimal and octal numbers and provides two worksheet functions for that very purpose.

The first function is the DEC2OCT function. Suppose you have a decimal value in cell B7, and you want to know how to express that value in octal. In a different cell you could use the following formula:

=DEC2OCT(B7)

If the value in B7 was 456, the result of the above formula would be 710. An interesting fact (and potential "gottcha") is that when the conversion is completed, Excel considers the result to be a number. Thus, if you added 8 to the resulting value above (710), Excel would return 718—a value impossible in octal. This simply means that Excel doesn't keep track of the numbering system used in a particular cell; it expects you to do that.

If you want to convert numbers back the other way, from octal to decimal, you can use the OCT2DEC worksheet function:

=OCT2DEC(B8)

If you try to use this function with a value that is clearly not octal (such as 718), then Excel returns a #NUM! error value.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (5656) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Converting to Octal.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Hyperlinks to PDF Files Won't Open

If you have a document that contains hyperlinks to a PDF file, it is possible that the links may not open the PDF file ...

Discover More

Inserting Today's Date

When writing letters, reports, or other date-dependent documents, you need to regularly insert the current date in the ...

Discover More

Different Cell Movement in a Single Worksheet

You can configure Excel to specify what happens when you press Enter in a cell. This is normally done on a global basis, ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Returning Item Codes Instead of Item Names

The data validation capabilities of Excel are really handy when you want to limit what is put into a cell. However, you ...

Discover More

Returning Values to the Left of a VLOOKUP

VLOOKUP is a great function to use in accessing data based on a lookup value. Problem is, you can't easily return ...

Discover More

Converting to Hexadecimal

Excel allows you to easily convert values from decimal to other numbering systems, such as hexadecimal. This tip explains ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 1 + 1?

2019-01-27 07:25:11

JMJ

Speaking of octal, do you know this old joke?

- The 31st of October is the Christmas for IT people !
- Why?
- Because 31OCT=25DEC


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.