CODE Excel Formula

Author Zaheer    Category Formulas     Tags ,

In Excel, Code Function returns the ASCIIValue of the character or first character in the cell.

The syntax for Code Function is: Code (text)

Text is specified character to retrieve ASCIIValue. If there’s more than one character, the function would return ASCIIValue for first character and just ignore all characters after the firsts.

Applies to: Excel 2003, Excel 2007, Excel XP and Excel 2000

How to Use Excel Code Function?

Excel’s Code functions determine the numeric demonstration for the initial character in the particular text string. The value is firmed by the character set used. This would be Macintosh character set for the Macintosh computers as well as ANSI characters for the Windows computer. Here are the following steps that will show you how you can use Excel Code function.

  • Study the syntax for Code. It’s Code (text_string) it is where text_string is text value. The Code will go again the code for first character in the text_string.
  • Use cell reference, named series or text string as an applicable input for Code function.  Code functions would return the #Value! when the case can’t be determined to text value.
  • Come across the following easy examples for Code uses of:

Code (“A”) =65, Code (“B”) =66, Code (“C”) =67 and so on. These results assume that you are running Excel on a Windows computer.

Examine more complex uses of the function of the code:

Code (“Alphabet”) = 65. Note that only the code for the first character is returned.
Code (-1) = 45. The entry of -1 is implicitly converted to text “-1″ and the ASCII code “-” (the script) is 45.

Code (CHAR (23)) = 23. This usage shows that the function of the code is the inverse of Char.

Code (“”) = # VALUE! The empty text can not be resolved in a text value and therefore returns the #! The error code

Study of the ASCII character values ??to verify the results of code. Note that the values ??of characters 0 to 31 are printable and will be represented by a small square in Windows.

How to Use VBA Code in Excel?

You can find more than a few pieces of code in the pages of this website or a website, and decide. Add one of your books. The majority of the code can be added as follows:

1. Copy the code to use
2. Select the book you want to store the code
3. Hold down the Alt key and press F11 to open Visual Basic Editor
4. Choose Insert | Module (to insert a new module of code)
5. Now you can see the cursor in the code window of a new module has been inserted. Select Edit and Paste from the toolbar.
6. Now hold down the Alt key and press F11 to return to the main Excel window.
7. To run the code: Select Tools | Macro | Macros from the toolbar
8. You will see a popup with the list of available macros. Select the macro you want to use and click Run.

Excel Functions: Text, ABS and the number or date formats

The text () and functions ‘and’ is very useful to include the numerical values ??of cells within meaningful phrases that can be understood by a layman. The statements can be built that combine words and numeric values ??(for example: “The budget for £ 23,000 was spent in April”).

The ‘and’ symbol is not strictly a function. It is an operator which can be used to join (or concatenate) and two chains or fragments of text.

For example: = “The difference is” and D2 in cell D2 contains “adverse” or “favorable”

If you join a piece of text and a number or date of the appearance and format of the series can be unpredictable unless you are using the text function. The TEXT function converts a number to text format and also gives you the look you need.

It takes the form: = TEXT (value, “FormatCode”).

The complicated aspect of this role includes FormatCodes. Some of them are shown in the following example and tables. Alternatively, you can use Excel Help and look for the ‘format numbers: Custom formats.

Post comment