excel常用函数代码_30天中的30个Excel函数:07 –代码

excel常用函数代码

Congratulations! You've made it to the first weekend in the 30XL30D challenge, including yesterday's investigation of the FIXED function.

恭喜你! 您已经完成了30XL30D挑战的第一个周末,包括昨天对FIXED函数的研究。

We'll take it easy today, and look at a function that doesn't have too many examples -- the CODE function. It can work with other functions, in long, complicated formulas, but today we'll focus on what it can do on its own, and in simple formulas.

今天,我们将轻松一点,看看一个没有太多示例的函数-CODE函数。 它可以与其他函数一起工作,包括冗长而复杂的公式,但是今天,我们将重点介绍它可以自己完成的事情以及简单的公式。

NOTE: You can have all of the 30 Functions content in an easy-to-use single reference file -- the 30 Excel Functions in 30 Days eBook Kit ($10).

注意:您可以在一个易于使用的单个参考文件中获得这30个函数的全部内容-30天电子书工具包中30个Excel函数 (10美元)。

So, let's take a look at the CODE information and examples, and if you have other tips or examples, please share them in the comments. Wear your secret deCODEr ring, if you have one.

因此,让我们看一下CODE信息和示例,如果还有其他提示或示例,请在注释中分享。 如果有,请戴上秘密的deCODEr戒指。

功能07:CODE (Function 07: CODE)

The CODE function returns a numeric code for the first character in a text string. For Windows, the returned code is from the ANSI character set, and for Macintosh, the code is from the Macintosh character set.

CODE函数返回文本字符串中第一个字符的数字代码。 对于Windows,返回的代码来自ANSI字符集,对于Macintosh,返回的代码来自Macintosh字符集。

Code00

您如何使用CODE? (How Could You Use CODE?)

The CODE function can help unravel mysteries in your data, such as:

CODE函数可以帮助您解开数据中的奥秘,例如:

  • What hidden character is at the end of imported text?

    导入文本的末尾是什么隐藏字符?
  • How can I type a special symbol in a cell?

    如何在单元格中键入特殊符号?

代码语法 (CODE Syntax)

The CODE function has the following syntax:

CODE函数具有以下语法:

    • text is the text string from which you want the first character's code

      text是您要从中获取第一个字符代码的文本字符串

    CODE(text)

    CODE(文字)

代码陷阱 (CODE Traps)

Results could be different if you switch to a different operating system. The codes for the ASCII character set (codes 32 to 126) are consistent, and most can be found on your keyboard.

如果切换到其他操作系统,结果可能会有所不同。 ASCII字符集的代码(代码32至126)是一致的,并且大多数都可以在键盘上找到。

However, the characters for the higher numbers (129 to 254) may vary, as you can see in the comparison charts shown here:

但是,较高数字(129至254)的字符可能会有所不同,如您在此处显示的比较表中所看到的:

Differences between ANSI, ISO-8859-1 and MacRoman character sets

ANSI,ISO-8859-1和MacRoman字符集之间的区别

For example, the ANSI code 189 is ½ and for the Macintosh it is O

例如,ANSI代码189是½,而对于Macintosh,它是O

示例1:获取隐藏字符的代码 (Example 1: Get Hidden Character's Code)

When you copy text from a website, it might include hidden characters. The CODE function can be used to identify what those hidden characters are.

从网站复制文本时,其中可能包含隐藏字符。 CODE功能可用于识别那些隐藏字符。

For example, there is a text string in cell B3, and only "test" is visible -- 4 characters. In cell C3, the LEN function shows that there are 5 characters in cell B3.

例如,在单元格B3中有一个文本字符串,只有“ test”可见-4个字符。 在单元格C3中,LEN函数显示单元格B3中有5个字符。

To identify the last character's code, you can use the RIGHT function, to return the last character. Then, use the CODE function to return the code for that character.

要标识最后一个字符的代码,可以使用RIGHT函数返回最后一个字符。 然后,使用CODE函数返回该字符的代码。

=CODE(RIGHT(B3,1))

=代码(RIGHT(B3,1))

Code01

In cell D3, the RIGHT/CODE formula shows that the last character has the code 160, which is a non-breaking space used on websites.

在单元格D3中,RIGHT / CODE公式显示最后一个字符的代码为160,这是网站上使用的不间断空格。

示例2:查找符号代码 (Example 2: Find a Symbol's Code)

To insert special characters in an Excel worksheet, you can use the Symbol command on the Ribbon's Insert tab. For example, you can insert a degree symbol ° or a copyright symbol ©.

要在Excel工作表中插入特殊字符,可以在功能区的“插入”选项卡上使用“符号”命令。 例如,您可以插入度数符号°或版权符号©。

After you insert a symbol, you can determine its code, by using the CODE function

插入符号后,可以使用CODE函数确定其代码

=IF(C3="","",CODE(RIGHT(C3,1)))

= IF(C3 =“”,“”,CODE(RIGHT(C3,1)))

Code02

Once you know the code, you can use the numeric keypad (not the regular numbers) to insert the symbol. The code for the copyright symbol is 169. Follow these steps to enter that symbol in a cell.

一旦知道密码,就可以使用数字键盘(而不是常规数字)插入符号。 版权符号的代码为169。请按照以下步骤在单元格中输入该符号。

在带有数字小键盘的键盘上 (On a keyboard with a numeric keypad)
  1. On the keyboard, press the Alt key

    在键盘上,按Alt键
  2. On the numeric keypad, type the code as a 4-digit number (add leading zeros if necessary): 0169

    在数字小键盘上,输入代码为4位数字(如有必要,请添加前导零): 0169

  3. Press Enter, to see the copyright symbol in the cell.

    按Enter键,以在单元格中查看版权符号。
没有数字小键盘的键盘上 (On a keyboard with no numeric keypad)

On your laptop, you might need to press special keys to use the numeric keypad function. Check the owner's manual, for directions. Here's what works on my Dell laptop.

在笔记本电脑上,您可能需要按特殊键才能使用数字小键盘功能。 查看用户手册中的指示。 这是我的戴尔笔记本电脑上可以使用的功能。

  1. Press the Fn key, and the F4 key, to enable NumLock

    按Fn键和F4键以启用NumLock
  2. Locate the numeric keypad within the letters on the keyboard. On my keyboard, J=1, K=2, etc.

    在键盘上的字母内找到数字小键盘。 在我的键盘上,J = 1,K = 2,依此类推。
  3. Press the Alt key, and the Fn key, and using the numeric keypad, type the code as a 4-digit number (add leading zeros if necessary): 0169

    按Alt键和Fn键,然后使用数字键盘将代码键入为4位数字(如有必要,添加前导零): 0169

  4. Press Enter, to see the copyright symbol in the cell.

    按Enter键,以在单元格中查看版权符号。
  5. When finished, press the Fn key, and the F4 key, to disable NumLock

    完成后,按Fn键和F4键以禁用NumLock

下载CODE功能文件 (Download the CODE Function File)

To see the formulas used in today's examples, you can download the CODE function sample workbook. The file is zipped, and is in Excel 2007 file format.

要查看当前示例中使用的公式,可以下载CODE函数示例工作簿 。 该文件已压缩,并且为Excel 2007文件格式。

观看CODE视频 (Watch the CODE Video)

To see a demonstration of the examples in the CODE function sample workbook, you can watch this short Excel video tutorial.

要查看CODE函数示例工作簿中示例的演示,您可以观看此简短的Excel视频教程。

演示地址

翻译自: https://contexturesblog.com/archives/2011/01/08/30-excel-functions-in-30-days-07-code/

excel常用函数代码

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值