Engineering All versions ◉ 41 views

=HEX2OCT()

Converts a hexadecimal number to octal.

Applies To: Excel for Microsoft 365Excel for Microsoft 365 for MacExcel 2024Excel 2021Excel 2021 for MacExcel 2019Excel 2019 for MacExcel 2016
=HEX2OCT(number, [places])
Hover argument names in the table for details.
Output typeNumber/Text
Popularity44 / 100
VolatileNo
Dynamic ArrayNo
Download sample .xlsx ▦ Try in Playground Dedicated file for this function — safe & lightweight · sample data + live formulas
Share:

⬇ Download Sample Workbook

A dedicated .xlsx for =HEX2OCT() 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)
Download HEX2OCT.xlsx ~ 8–12 KB · No macros

⇪ Share

Send this function to friends

Quiz this function

%d questions — syntax, example & errors — test yourself!

◧ Arguments

ArgumentTypeRequiredDescription
number Text Required The hexadecimal number you want to convert. Number cannot contain more than 10 characters. The most significant bit of number is the sign bit. The remaining 39 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, HEX2OCT uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).

▣ Examples

Converts hexadecimal F to octal with 3 characters (the leading 0 is "padding"). =HEX2OCT("F", 3)
Result: 017
Converts hexadecimal 3B4E to octal =HEX2OCT("3B4E")
Result: 35516
Converts hexadecimal FFFFFFFF00 to octal =HEX2OCT("FFFFFFFF00")
Result: 7777777400

§ Remarks

  • If number is negative, HEX2OCT ignores places and returns a 10-character octal number.
  • If number is negative, it cannot be less than FFE0000000, and if number is positive, it cannot be greater than 1FFFFFFF.
  • If number is not a valid hexadecimal number, HEX2OCT returns the #NUM! error value.
  • If HEX2OCT requires more than places characters, it returns the #NUM! error value.
  • If places is not an integer, it is truncated.
  • If places is nonnumeric, HEX2OCT returns the #VALUE! error value.
  • If places is negative, HEX2OCT returns the #NUM! error value.

✦ Tips

  • If number is negative, HEX2OCT ignores places and returns a 10-character octal number.
  • If number is negative, it cannot be less than FFE0000000, and if number is positive, it cannot be greater than 1FFFFFFF.
  • If places is not an integer, it is truncated.

⚠ Common Errors

#NUM! If number is not a valid hexadecimal number, HEX2OCT returns the #NUM! error value. If HEX2OCT requires more than places characters, it returns the #NUM! error value. If places is negative, HEX2OCT returns the #NUM! error value.
Fix: Valid hex
#VALUE! If places is nonnumeric, HEX2OCT 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!

✍️ Add comment / question

captcha
🔒 Your comment will be published after review.