Engineering
All versions
◉ 12 views
=OCT2HEX()
Converts an octal number to hexadecimal.
Applies To:
Excel for Microsoft 365Excel for Microsoft 365 for MacExcel 2024Excel 2021Excel 2021 for MacExcel 2019Excel 2019 for MacExcel 2016
=OCT2HEX(number, [places])
Hover argument names in the table for details.
Output typeNumber/Text
Popularity45 / 100
VolatileNo
Dynamic ArrayNo
Download sample .xlsx ▦ Try in Playground
Dedicated file for this function — safe & lightweight · sample data + live formulas
⬇ Download Sample Workbook
A dedicated .xlsx for =OCT2HEX() with Persian sample data & live formulas — open in Excel and practice.
- Sheet “Sample” — data table + formula in place
- Sheet “Guide” — syntax, arguments & tips from this page
- Instant & secure (token + rate limit)
Quiz this function
%d questions — syntax, example & errors — test yourself!
◧ Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
number |
Text | Required | The octal number you want to convert. Number may not contain more than 10 octal characters (30 bits). The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation. |
places |
Number | Optional | The number of characters to use. If places is omitted, OCT2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros). |
▣ Examples
Converts octal number 100 to hexadecimal form with 4 characters.
=OCT2HEX(100, 4)
Result:
0040
Converts octal number 7777777533 to hexadecimal form.
=OCT2HEX(7777777533)
Result:
FFFFFFFF5B
§ Remarks
- If number is negative, OCT2HEX ignores places and returns a 10-character hexadecimal number.
- If number is not a valid octal number, OCT2HEX returns the #NUM! error value.
- If OCT2HEX requires more than places characters, it returns the #NUM! error value.
- If places is not an integer, it is truncated.
- If places is nonnumeric, OCT2HEX returns the #VALUE! error value.
- If places is negative, OCT2HEX returns the #NUM! error value.
- Top of Page
✦ Tips
- If number is negative, OCT2HEX ignores places and returns a 10-character hexadecimal number.
- If places is not an integer, it is truncated.
⚠ Common Errors
#NUM!
If number is not a valid octal number, OCT2HEX returns the #NUM! error value. If OCT2HEX requires more than places characters, it returns the #NUM! error value. If places is negative, OCT2HEX returns the #NUM! error value.
Fix: Enter a valid octal number
#VALUE!
If places is nonnumeric, OCT2HEX returns the #VALUE! error value.
Fix: برای places یک مقدار عددی وارد کنید.
💬 Comments & Q&A 0 approved
🔒 Your comment will be published after review.Share your thoughts — visible after admin approval
No comments yet — be the first!