# Converting to Octal

Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Converting to Octal.

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 (2316) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Converting to Octal.

Related Tips:

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

### Leave your own comment:

 *Name: Email: Notify me about new comments ONLY FOR THIS TIP Notify me about new comments ANYWHERE ON THIS SITE Hide my email address *Text: *What is 5+3 (To prevent automated submissions and spam.)

### Comments for this tip:

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)

# Our Company

Sharon Parq Associates, Inc.

# Our Sites

Tips.Net

Beauty and Style

Cars

Cleaning

Cooking

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2016)

Gardening

Health

Home Improvement

Money and Finances

Organizing

Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2016)

Excel Products

Word Products

# Our Authors

Author Index

Write for Tips.Net

Copyright © 2017 Sharon Parq Associates, Inc.