excel关联规则算法
As Juliet famously said to Romeo, "What's in a name?" And she was talking about rows (misspelled as "rose"), so maybe Juliet was using a spreadsheet at the time. There are special rules for Excel names, but you might be surprised to see what is allowed.
正如朱丽叶(Juliet)对罗密欧(Romeo)所说的那样:“名字叫什么?” 她正在谈论行 (拼写为“ rose”),所以也许朱丽叶当时正在使用电子表格。 Excel名称有特殊的规则,但是您可能会惊讶地看到允许使用的名称。
Excel中的名称 (Names in Excel)
In Excel, you can create names that refer to cells, or to a constant value, or a formula. After you create Excel names, you can use them in formulas, or quickly go to a named range.
在Excel中,您可以创建引用单元格,常量值或公式的名称。 创建Excel名称后 ,可以在公式中使用它们,也可以快速转到指定的范围。
There are rules for Excel Names, and here's what Microsoft says is allowed. It seems clear, but a few of the rules aren't as ironclad as they look:
Excel名称有规则,这是Microsoft所说的被允许的 。 看起来似乎很清楚,但是其中一些规则并不像看起来那么铁定:
-
- letter 信
- underscore (_) 下划线(_)
- backslash (\). 反斜杠(\)。
The first character of a name must be one of the following characters:
名称的第一个字符必须是以下字符之一:
-
- letters 字母
- numbers 数字
- periods 期间
- underscore characters 下划线字符
-
-
Space characters are not allowed as part of a name.
名称中不允许使用空格字符 。
-
Names can't look like cell addresses, such as A$35 or R2D2
名称看起来不像是单元格地址 ,例如A $ 35或R2D2
-
C, c, R, r -- can't be used as names -- Excel uses them as selection shortcuts
C,c,R,r-不能用作名称-Excel将它们用作选择快捷方式
The following are not allowed:
以下是不允许的 :
-
-
Names are not case sensitive. For example, North and NORTH are treated as the same name.
名称不区分大小写 。 例如,将North和NORTH视为相同的名称。
如何命名细胞 (How To Name Cells)
It's easy to name a range of cells – here's what I usually do (there's a video at the end of this article too):
命名一系列单元格很容易-这是我通常要做的(本文结尾处还有一个视频):
- Select the cells that you want to name 选择您要命名的单元格
- Type a valid one-word name for those cells, in the Name Box at the left of the Formula Bar. 在编辑栏左侧的“名称框”中为这些单元格键入一个有效的单字名称。
- Press Enter, to complete the name. If you forget that step, the name doesn't stick. 按Enter键完成名称。 如果您忘记了这一步,该名称就不会保留。
Later, you can use those names in formulas, or for navigation.
以后,您可以在公式中或导航中使用这些名称。
快速名称 (Quick Names)
Another easy way to create names is based on text that you're already entered on the worksheet. For example, type "Months", then the month names in the 12 cells below that.
创建名称的另一种简便方法是基于您已经在工作表上输入的文本。 例如,键入“月”,然后在其下方的12个单元格中输入月名称。
- First, select the heading cell, and the cells that you want to name. 首先,选择标题单元格以及要命名的单元格。
- Then, on Excel's Formulas tab, click the Create From Selection command. 然后,在Excel的“公式”选项卡上,单击“从选择中创建”命令。
- Check the box to tell Excel where your headings are (top, left, bottom or right), and click OK 选中复选框以告知Excel标题在哪里(顶部,左侧,底部或右侧),然后单击“确定”。
- Excel names the ranges with valid names, based on your headings Excel根据您的标题使用有效名称命名范围
Since Excel creates the names in this method, you don't have to worry about what's valid.
由于Excel使用此方法创建名称,因此您不必担心有效的名称。
NOTE: You can see the step in the video at the end of this article.
注意:您可以在本文结尾的视频中看到该步骤。
超越基本规则 (Beyond the Basic Rules)
Even though Microsoft's rules for Excel names say that you must use only letters, numbers, periods, underscores and backslashes, other characters are allowed. It seems that "letters" has a broad interpretation.
即使Microsoft的Excel名称规则规定您只能使用字母,数字,句点,下划线和反斜线,也可以使用其他字符。 似乎“信件”具有广泛的解释。
I learned about "beyond the basics" technique from Peter B., who sent me a workbook in which he used Unicode text in his Excel names (shown below). I didn't know that was possible. Thanks, Peter!
我从Peter B.那里学到了“超越基础”的技术,他给了我一本工作簿,其中他在Excel名称中使用Unicode文本(如下所示)。 我不知道那是可能的。 谢谢,彼得!
我对规则的考验 (My Test of the Rules )
Inspired by Peter's examples, I did a few simple name tests, using characters from the "Alt and Number Keypad" set. For example, I typed an "a" in the Name Box, then Alt+1, Alt+30 and Alt+31. That means "a happy faces goes up and down", in case you were wondering.
受彼得的示例启发,我使用“ Alt and Number Keypad”集中的字符进行了一些简单的名称测试。 例如,我在“名称”框中键入“ a”,然后输入Alt + 1,Alt + 30和Alt + 31。 如果您想知道的话,这意味着“一张幸福的脸会上下波动”。
In the screen shot below, you can see that name in the Name Box drop down list, along with a few other unconventional names that I created.
在下面的屏幕快照中,您可以在“名称框”下拉列表中看到该名称,以及我创建的其他一些非常规名称。
Excel used the characters from cell D2, when I created a name using the "Create From Selection technique on that range.
当我在该范围内使用“从选择中创建技术”创建名称时,Excel使用了D2单元格中的字符。
However, when I created a couple of names in the Name Manager, the special characters show up correctly there, but appear as question marks in the Name Box drop down list. You can see a couple of those in the screen shot above.
但是,当我在“名称管理器”中创建几个名称时,特殊字符在那里正确显示,但是在“名称框”下拉列表中显示为问号。 您可以在上面的屏幕截图中看到其中的几个。
测试Excel名称规则 (Testing the Rules for Excel Names)
After looking at Peter's examples, and doing a few experiments, I did some searching, so see what documentation there might be online, for these anomalies. What is allowed, and what isn't?
在查看了Peter的示例并进行了一些实验之后,我进行了一些搜索,以查看这些异常可能在线上有哪些文档。 允许什么,不允许什么?
An link in an old Excel newsgroup post led me to a treasure trove of information on rules for Excel names – Martin Trummer's GitHub project on excel-names. Martin has done an in-depth study of what's allowed, beyond the basic letters and numbers.
一个旧的Excel新闻组帖子中的链接将我带到了有关Excel名称规则的信息宝库-Martin Trummer的excel-names GitHub项目 。 除了基本的字母和数字外,马丁还对允许的内容进行了深入的研究。
Go to Martin's project page, and you'll see his written examples, and there is an Excel file to download. Thanks to Martin, for doing this research!
转到Martin的项目页面,您将看到他的书面示例,并且有一个Excel文件可供下载。 感谢马丁,进行了这项研究!
视频:命名单元格范围 (Video: Name a Range of Cells)
Watch this short video to see how to name a group of cells, go to that named group of cells, and use the name in a formula.
观看此简短视频,了解如何命名一组单元格,转到该命名的一组单元格,并在公式中使用该名称。
视频:通过选择创建Excel名称 (Video: Create an Excel Name from Selection)
To quickly name individual cells, or individual ranges, you can use heading cell text as the names. Watch this video to see the steps, and go to the Excel Names page on my website for more details and videos.
要快速命名单个单元格或单个范围,可以使用标题单元格文本作为名称。 观看此视频以查看步骤,然后转到我的网站上的“ Excel名称”页面以获取更多详细信息和视频。
翻译自: https://contexturesblog.com/archives/2017/12/07/what-are-the-rules-for-excel-names/
excel关联规则算法


所有评论(0)