Decimal to hex excel

Excel для Microsoft 365 Excel для Microsoft 365 для Mac Excel для Интернета Excel 2021 Excel 2021 для Mac Excel 2019 Excel 2019 для Mac Excel 2016 Excel 2016 для Mac Excel 2013 Excel 2010 Excel 2007 Excel для Mac 2011 Excel Starter 2010 Еще…Меньше

В этой статье описаны синтаксис формулы и использование функции ДЕС.В.ШЕСТН в Microsoft Excel.

Описание

Преобразует десятичное число в шестнадцатеричное.

Синтаксис

ДЕС.В.ШЕСТН(число;[разрядность])

Аргументы функции ДЕС.В.ШЕСТН описаны ниже.

  • Число    — обязательный аргумент. Преобразуемое десятичное число. Если оно отрицательное, то разрядность игнорируется и функция ДЕС.В.ШЕСТН возвращает 10-значное (40-битное) шестнадцатеричное число, в котором самый старший бит является знаковым битом. Остальные 39 бит являются битами значения. Отрицательные числа представляются в дополнительных кодах.

  • Разрядность    Необязательный. Количество знаков в записи числа. Если разрядность опущена, функция ДЕС.В.ШЕСТН использует минимально необходимое количество знаков. Разрядность используется, чтобы приписать возвращаемому значению ведущие нули.

Замечания

  • Если число < -549 755 813 888 или число > 549 755 813 887, то DEC2HEX возвращает #NUM! значение ошибки #ЗНАЧ!.

  • Если число не является числом, то DEC2HEX возвращает #VALUE! значение ошибки #ЗНАЧ!.

  • Если для результата DEC2HEX требуется больше количества знаков Знаков знаков Знаков после заданного числа знаков Знаков после заданного числа знаков, возвращается #NUM! значение ошибки #ЗНАЧ!.
    Например, DEC2HEX(64;1) возвращает значение ошибки, так как для результата (40) требуется два знака.

  • Если значение аргумента «разрядность» не является целым числом, оно усекается.

  • Если число не является числом, то DEC2HEX возвращает #VALUE! значение ошибки #ЗНАЧ!.

  • Если «количество» отрицательное, то DEC2HEX возвращает #NUM! значение ошибки #ЗНАЧ!.

Пример

Скопируйте образец данных из следующей таблицы и вставьте их в ячейку A1 нового листа Excel. Чтобы отобразить результаты формул, выделите их и нажмите клавишу F2, а затем — клавишу ВВОД. При необходимости измените ширину столбцов, чтобы видеть все данные.

Формула

Описание

Результат

=ДЕС.В.ШЕСТН(100;4)

Преобразует десятичное число 100 в шестнадцатеричное из 4 знаков (с «приписанными» двумя ведущими нулями).

0064

=ДЕС.В.ШЕСТН(-54)

Преобразует десятичное значение -54 в шестнадцатеричное

FFFFFFFFCA

=ДЕС.В.ШЕСТН(28)

Преобразует десятичное значение 28 в шестнадцатеричное.

1C

=ДЕС.В.ШЕСТН(64;1)

Возвращает #NUM! из-за того, что для результата (40) требуется 2 знака.

#ЧИСЛО!

Нужна дополнительная помощь?

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 Excel 2016 for Mac Excel 2013 Excel 2010 Excel 2007 Excel for Mac 2011 Excel Starter 2010 More…Less

This article describes the formula syntax and usage of the DEC2HEX function in Microsoft Excel.

Description

Converts a decimal number to hexadecimal.

Syntax

DEC2HEX(number, [places])

The DEC2HEX function syntax has the following arguments:

  • Number    Required. The decimal integer you want to convert. If number is negative, places is ignored and DEC2HEX returns a 10-character (40-bit) hexadecimal number in which the most significant bit is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two’s-complement notation.

  • Places    Optional. The number of characters to use. If places is omitted, DEC2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).

Remarks

  • If Number is < -549,755,813,888 or if Number is > 549,755,813,887, DEC2HEX returns the #NUM! error value.

  • If Number is non-numeric, DEC2HEX returns the #VALUE! error value.

  • If the result of DEC2HEX requires more than the number of specified Places characters, it returns the #NUM! error value.
    For example, DEC2HEX(64,1) returns the error value because the result (40) requires two characters.

  • If Places is not an integer, the value of Places is truncated.

  • If Places is non-numeric, DEC2HEX returns the #VALUE! error value.

  • If Places is negative, DEC2HEX returns the #NUM! error value.

Example

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

Formula

Description

Result

=DEC2HEX(100, 4)

Converts decimal value 100 to hexadecimal with 4 characters («padded» with two leading zeros).

0064

=DEC2HEX(-54)

Converts decimal value -54 to hexadecimal

FFFFFFFFCA

=DEC2HEX(28)

Converts decimal value 28 to hexadecimal.

1C

=DEC2HEX(64,1)

Returns the #NUM! error value because the result (40) requires 2 character places.

#NUM!

Need more help?

Содержание

  1. DEC2HEX function
  2. Description
  3. Syntax
  4. Remarks
  5. Example
  6. Функция ДЕС.В.ШЕСТН
  7. Описание
  8. Синтаксис
  9. Замечания
  10. Пример
  11. Converting to Hexadecimal
  12. How to use the Excel DEC2HEX Function
  13. Syntax for DEC2HEX Function
  14. Setting up Data
  15. Notes
  16. How to format a Microsoft Excel 2007 cell in hexadecimal?
  17. 6 Answers 6

DEC2HEX function

This article describes the formula syntax and usage of the DEC2HEX function in Microsoft Excel.

Description

Converts a decimal number to hexadecimal.

Syntax

The DEC2HEX function syntax has the following arguments:

Number Required. The decimal integer you want to convert. If number is negative, places is ignored and DEC2HEX returns a 10-character (40-bit) hexadecimal number in which the most significant bit is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two’s-complement notation.

Places Optional. The number of characters to use. If places is omitted, DEC2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).

If Number is 549,755,813,887, DEC2HEX returns the #NUM! error value.

If Number is non-numeric, DEC2HEX returns the #VALUE! error value.

If the result of DEC2HEX requires more than the number of specified Places characters, it returns the #NUM! error value.
For example, DEC2HEX(64,1) returns the error value because the result (40) requires two characters.

If Places is not an integer, the value of Places is truncated.

If Places is non-numeric, DEC2HEX returns the #VALUE! error value.

If Places is negative, DEC2HEX returns the #NUM! error value.

Example

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

Converts decimal value 100 to hexadecimal with 4 characters («padded» with two leading zeros).

Converts decimal value -54 to hexadecimal

Converts decimal value 28 to hexadecimal.

Returns the #NUM! error value because the result (40) requires 2 character places.

Источник

Функция ДЕС.В.ШЕСТН

В этой статье описаны синтаксис формулы и использование функции ДЕС.В.ШЕСТН в Microsoft Excel.

Описание

Преобразует десятичное число в шестнадцатеричное.

Синтаксис

Аргументы функции ДЕС.В.ШЕСТН описаны ниже.

Число — обязательный аргумент. Преобразуемое десятичное число. Если оно отрицательное, то разрядность игнорируется и функция ДЕС.В.ШЕСТН возвращает 10-значное (40-битное) шестнадцатеричное число, в котором самый старший бит является знаковым битом. Остальные 39 бит являются битами значения. Отрицательные числа представляются в дополнительных кодах.

Разрядность Необязательный. Количество знаков в записи числа. Если разрядность опущена, функция ДЕС.В.ШЕСТН использует минимально необходимое количество знаков. Разрядность используется, чтобы приписать возвращаемому значению ведущие нули.

Замечания

Если число 549 755 813 887, то DEC2HEX возвращает #NUM! значение ошибки #ЗНАЧ!.

Если число не является числом, то DEC2HEX возвращает #VALUE! значение ошибки #ЗНАЧ!.

Если для результата DEC2HEX требуется больше количества знаков Знаков знаков Знаков после заданного числа знаков Знаков после заданного числа знаков, возвращается #NUM! значение ошибки #ЗНАЧ!.
Например, DEC2HEX(64;1) возвращает значение ошибки, так как для результата (40) требуется два знака.

Если значение аргумента «разрядность» не является целым числом, оно усекается.

Если число не является числом, то DEC2HEX возвращает #VALUE! значение ошибки #ЗНАЧ!.

Если «количество» отрицательное, то DEC2HEX возвращает #NUM! значение ошибки #ЗНАЧ!.

Пример

Скопируйте образец данных из следующей таблицы и вставьте их в ячейку A1 нового листа Excel. Чтобы отобразить результаты формул, выделите их и нажмите клавишу F2, а затем — клавишу ВВОД. При необходимости измените ширину столбцов, чтобы видеть все данные.

Преобразует десятичное число 100 в шестнадцатеричное из 4 знаков (с «приписанными» двумя ведущими нулями).

Преобразует десятичное значение -54 в шестнадцатеричное

Преобразует десятичное значение 28 в шестнадцатеричное.

Возвращает #NUM! из-за того, что для результата (40) требуется 2 знака.

Источник

Converting to Hexadecimal

Written by Allen Wyatt (last updated February 15, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003

If you do any programming, you know how important hexadecimal numbers are. Hexadecimal numbers are used to represent values that can be easily understood by both humans and programming languages. In the hexadecimal numbering system, each digit can vary between 0 and F. Thus, 0 through 9 are the same as in our decimal numbering system, and A through F are converted to 10 through 15 in decimal.

How can Excel help with hexadecimal numbers? It includes a worksheet function that allows you to easily convert a number from decimal to hexadecimal. For instance, let’s say you have a decimal value in E3. If you wanted to know the hexadecimal equivalent, you would use the following:

If the value in E3 was 123, the result of the above formula would be 7B. The DEC2HEX worksheet function can be used to convert any decimal values between -549,755,813,888 and 549,755,813,887.

Once the conversion is done, the value in the cell is considered text. This means that you cannot use the results of DEC2HEX in a numeric formula.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2308) 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 Hexadecimal.

Author Bio

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. Learn more about Allen.

Источник

How to use the Excel DEC2HEX Function

We have some very effective functions when it comes to working with numbers in Excel. DEC2HEX is one such function. It takes a decimal number and converts it to its hexadecimal counterpart. In this tutorial, we will learn how to use the DEX2HEC function in Excel.

Figure 1. Example of How to Use the DEC2HEX Function in Excel

Syntax for DEC2HEX Function

  • Number: Required. This is the decimal number to convert to its hexadecimal equivalent.
  • [places]: Optional. Rounds up the output number with zeros up to the digits specified. If we omit it, DEC2HEX returns the minimum number of characters needed to show the number.

Setting up Data

The following data set has some sample decimal numbers. Column A contains the numbers.

Figure 2. The Sample Data Set

To convert these numbers to hexadecimal in column B:

  • We need to click cell B2 with the mouse.
  • Assign the formula =DEC2HEX(A2,7) to the formula bar of cell B2.
  • Press Enter .

Figure 3. Example of Applying the DEC2HEX Function

  • Assign the formula =DEC2HEX(A3) to cell B3. Press Enter and drag the fill handle from cells B3 to B5.

Column B will now have the hexadecimal representation of the decimal numbers in column A. Cell B2 has the formula with the places argument 7. This rounds up the output 600D with 0’s in the first three digits.

Notes

  • The DEC2HEX function requires a valid input of a decimal number within the range [ -2^39, 2^39 – 1] . Otherwise it returns a #NUM! error.
  • DEC2HEX returns a #VALUE! error if the number is non numeric.
  • It returns a #NUM! Error if the result of DEC2HEX requires more numbers than the places argument.
  • Excel truncates the value of the places argument if it is not an integer .
  • DEC2HEX returns a #VALUE! error if places is non numeric . It returns a #NUM! error if places is negative .

Figure 4. Example of Common Errors of the DEC2HEX Function

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Источник

How to format a Microsoft Excel 2007 cell in hexadecimal?

I would like a format a cell in Microsoft Excel 2007 in hexadecimal but am not finding how to do this.

Is there a built-in way to change the base from 10 to 16 for a cell?

6 Answers 6

As mentioned earlier, the formula =DEC2HEX(A1) converts to hex, and DEC2HEX(A1,8) converts to hex with 0 prefix to denote 32 bits. While adding the leading 0’s makes the numbers more readable, especially if you use a fixed point font, the hex and decimal versions can get mixed up when all of the digits in the number happen to be 0-9 (e.g. 327701=50015).

An improvement is to add the «0x» prefix. There are 2 ways to do this. =»0x»&DEC2HEX(A1,8) will do the trick, but it changes the field to a text field, so it can no longer easily be used in formulas. Another method is to use a custom format. If you apply the custom format «0x»@ to the cell, then the value of the cell can still be used in an equation. Examples:

However, large numbers with varying digits can still be hard to read, so I like to put commas into decimal numbers and «_»s into hex numbers. First you need to get the upper and lower 16 bits of the number. The upper 16 bits of a 32-bit number can be retrieved with = INT( A1 / 2^16 ). Dividing by 2^16 acts like a right shift of 16 bits, and the INT removes the fractional remainder. MOD can be used to get the lower 16 bits of any 32 or 64-bit number; =MOD(A1, 2^16). The MOD effectively gets the remainder back, which is the lower 16 bits. Here is a table that shows this in action.

Источник

Функция ДЕС.В.ШЕСТН преобразует десятичное число в шестнадцатеричное. Как и большинство функций категории «Инженерные», работает начиная с 2007-й версии Excel.

Описание функции ДЕС.В.ШЕСТН

Преобразует десятичное число в шестнадцатеричное.

Синтаксис

=ДЕС.В.ШЕСТН(число; [разрядность])

Аргументы

числоразрядность

Обязательный аргумент. Преобразуемое десятичное число. Если оно отрицательное, то разрядность игнорируется и функция ДЕС.В.ШЕСТН возвращает 10-значное (40-битное) шестнадцатеричное число, в котором самый старший бит является знаковым битом. Остальные 39 бит являются битами значения. Отрицательные числа представляются в дополнительных кодах.

Необязательный аргумент. Количество знаков в записи числа. Если разрядность опущена, функция ДЕС.В.ШЕСТН использует минимально необходимое количество знаков. Разрядность используется, чтобы приписать возвращаемому значению ведущие нули.

Замечания

  • Число    — обязательный аргумент. Преобразуемое десятичное число. Если оно отрицательное, то разрядность игнорируется и функция ДЕС.В.ШЕСТН возвращает 10-значное (40-битное) шестнадцатеричное число, в котором самый старший бит является знаковым битом. Остальные 39 бит являются битами значения. Отрицательные числа представляются в дополнительных кодах.
  • Разрядность    — необязательный аргумент. Количество знаков в записи числа. Если разрядность опущена, функция ДЕС.В.ШЕСТН использует минимально необходимое количество знаков. Разрядность используется, чтобы приписать возвращаемому значению ведущие нули.

Пример

Дополнительные материалы

Статья по переводу чисел из разных систем счисления

In some cases, particularly in math calculations, you may need to convert decimal number to binary, octal or hex number or vice versa, if you are not good at the conversion, this job must be a problem for you. In this tutorial, I introduce the helpful tricks for you to quickly solve the conversion between decimal number and binary/octal/hex number in Excel.

Convert decimal number to binary/octal/hex with formulas

Convert decimal number to binary/octal/hex with Kutools for Excel good idea3

doc decimal to binary 5


arrow blue right bubble Convert decimal number to binary/octal/hex with formulas

There are some simple formulas that can quickly finish the conversion between decimal numbers and binary/octal/hex number.

Select a blank cell and type this formula =DEC2BIN(A1) to convert a decimal number to binary number, then press Enter key to get the result. And if you need, drag the auto fill handle down or right to fill the cells.

doc decimal to binary 1doc arrow rightdoc decimal to binary 2

To convert decimal to hex, octal or vice versa, you can take references form below table.

doc decimal to binary 3

Tip: In above formulas, A1 is the cell you use to convert.


arrow blue right bubble Convert decimal number to binary/octal/hex with Kutools for Excel

There is a multi-units converter called Unit Conversion which is one of utility of Kutools for Excel, can quickly convert between multiple measures.

After free installing Kutools for Excel, please do as below:

1. Select the data you need to convert, and click Kutools > ContentUnit Conversion. See screenshot:

doc decimal to binary 7

2. Select Hex from the Units dropdown list, and then select the units from the two lists, and you can preview the results in the right Preview pane. See screenshot:

doc decimal to binary 5

3. Click Ok, and the decimal numbers have been converted.

Tip:

With Unit Conversion of Kutools for Excel, you can add the converted results as comments and keep the original data by checking Add results as comment.

doc decimal to binary 6


Relative Articles:

  • How to convert gallon to liter/ounce or vice versa in Excel?
  • How to convert date to yyyy-mm-dd format in Excel?
  • How to convert a single row to multiple columns and rows in Excel?
  • How to convert time string to time in Excel?

The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails…
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns… Prevent Duplicate Cells; Compare Ranges
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select…
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more…
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic…
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF
  • More than 300 powerful features. Supports Office / Excel 2007-2021 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.

kte tab 201905


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!

officetab bottom

Comments (0)


No ratings yet. Be the first to rate!

Понравилась статья? Поделить с друзьями:
  • Decimal places in excel
  • Decided which category each word belongs to
  • Decide with word is the odd one out
  • Decide with category each word belongs to
  • Decide who or what the following word combinations describe read out the sentences