Tables Part 1: Working With Tables Of Data
列表(第一部分):處理列表中的數(shù)據(jù)
(譯者注:本文中的“列表”其原文為“Table”,在已經(jīng)發(fā)布的Excel中有一項功能稱為“模擬運算表”【在數(shù)據(jù)菜單中】,在其相應(yīng)當(dāng)英文版本中也是“Table”,本人認(rèn)為本文討論的Excel 12新功能不同于現(xiàn)在的模擬運算表,所以使用“列表”一詞,在最終發(fā)布的Excel 12中文版本中所使用的名稱可能與本文不同,特此說明。)
For the next few posts, I'd like to spend some time explaining the work we've done in Excel 12 to improve the experience of working with tabular data in Excel.
接下來幾章中,我將花一些時間來解釋一下Excel 12如何改善對于表格化數(shù)據(jù)(譯者注:原文中的Tabular Data)的處理。
One thing that we see pretty much every Excel user doing with some frequency is working with tables. Tables can mean different things to different people so let me briefly define what we think of when we use the word table. A table is a simple structure where each row corresponds to a single “thing“ (e.g. a specific transaction, an individual product, etc.), and each column denotes a specific piece of information that's shared by all rows (e.g. amount of each transaction, product quantity, etc.). Tables typically have a “header“ row at the top that defines the information that each column contains. Some examples of tables might be a list of financial transactions or the latest inventory numbers pulled from a server. Here's an example of a very simple (and fictitious) table.
我相信每一個Excel的用戶都會非常頻繁的用到表格。在不同場合“表格”這個詞有很多種含義,讓我先來簡單的定義一下我們所說的列表,列表是指一個簡單的結(jié)構(gòu),列表的行對應(yīng)于一個單一“項目”(例如:一個交易,一種產(chǎn)品等等),列表的列表示每個項目的某些具體信息(例如:每項交易的金額,產(chǎn)品數(shù)量等等)。典型的列表擁有標(biāo)題行,一般位于列表的第一行,它用來定義每列所包含的內(nèi)容,列表也可以是交易清單或者從服務(wù)器上得到的最新的庫存數(shù)量。這里有一個非常簡單的列表。
The two-dimensional nature of the spreadsheet makes it an obvious canvas for manipulating and analyzing tabular data. Excel, however, has traditionally offered very little in the way of features aimed at tabular data because it had no built-in knowledge of what a table is or how it should behave. We've done a lot of work to make tables a native structure in Excel 12. When Excel knows you are working with a tabular structure, it can react much more intelligently to the actions you perform in the grid. Let me demonstrate by way of a simple example. Here is what our table might look like if we formatted the table, applied a data bar to the Profit column, added a chart, and added a formula at the top of the sheet that totals the Profit column.
支持二維數(shù)據(jù)存儲的電子數(shù)據(jù)表格可以很容易的處理和分析表格化數(shù)據(jù),然而傳統(tǒng)的Excel只能提供很少的處理表格化數(shù)據(jù)的功能,究其原因在于Excel并沒有內(nèi)置關(guān)于列表的相關(guān)內(nèi)容,如列表是什么樣子的,如何操作列表。我們做了很多工作,使列表完全的融入Excel 12。對比以前在列表中進行數(shù)據(jù)操作,在新版本中,一旦Excel認(rèn)為用戶在使用列表,那么它將提供更智能化的反應(yīng),讓我們用一個簡單的例子解釋一下,下面是我們格式化后的列表,對于“Profit”列使用Data Bars(譯者注:如希望更多的了解Data Bars請參考本版面的帖子“條件格式概覽——Data bars”),添加一個圖表并且在列表上方添加一個公式用于計算“Profit”列數(shù)據(jù)的總和。
The next thing I might typically do is add some more data. Let's look at what happens when I type a value just below the table in cell D9.
接下來添加數(shù)據(jù),我僅在D9單元格輸入一個數(shù)值,我們看一下工作表有什么變化。
After I pressed Enter, several things happened for me automatically:
在我按下<Enter>鍵之后,工作表自動作出了如下的反應(yīng):
1. The value that I entered was consumed into the table. Excel assumed I was appending data to my table (if I wasn't, one click will tell Excel to not auto-expand the table)
2. When the table consumed the data, my table formatting automatically extended to the new row – and notice that it was smart enough to maintain my alternating row colors
3. The conditional formatting data bar also extended to the new row, so Excel is now using D5:D9 to calculate the relative size of the data bars
4. The formula at the top updated itself to include the new data
5. Finally, the chart updated as well to reflect the addition to our table
1. 我輸入的數(shù)據(jù)加入列表中,Excel假設(shè)我在向列表追加數(shù)據(jù) (如果用戶不需要這個結(jié)果,只需要點擊一下告知Excel不需要自動擴大列表)
2. 當(dāng)新數(shù)據(jù)融入列表時,我的列表格式自動擴展到新的數(shù)據(jù)所在行,請注意這項功能非常智能的延續(xù)了原來列表的間隔行顏色格式
3. 條件格式的數(shù)據(jù)條同樣擴展到新的數(shù)據(jù)行,Excel將用D5:D9的數(shù)據(jù)重新計算Data Bars的大小
4. 求和公式自動更新,結(jié)果將包含新添加的數(shù)據(jù)
5. 最后,圖表同時更新反映出列表中添加的數(shù)據(jù)
Without a table, I would have to manually adjust the cell formatting, conditional formatting, formula and chart every time I append a value. What would have taken half a dozen steps or more now happens for me automatically thanks to the table feature. This is because Excel now recognizes features like a table, table columns, table header and so forth, and can use that knowledge to make informed decisions about what to do while I'm working in the spreadsheet. The best part is that I am just scratching the surface here; it will take me several posts to fully explain the benefits of tables and all the new features surrounding it. For now let's cover some basics.
如果沒有上述的列表功能,每次追加數(shù)據(jù)時,我需要手工設(shè)置單元格格式,添加格式,公式和圖表,這些大約需要六步操作才能完成,由于列表功能的出現(xiàn),使得這些工作可以自動完成,新的Excel具備識別功能,它能夠識別列表,列,標(biāo)題等等,當(dāng)用戶在電子數(shù)據(jù)表格操作時,系統(tǒng)會作出相應(yīng)當(dāng)反應(yīng)。在這里我們只是簡單的介紹列表功能,在隨后的帖子中,我將詳細闡述使用列表的好處和所有相關(guān)的新功能,現(xiàn)在讓我介紹一下基本知識。
Creating Tables
生成列表
A table can be created simply by clicking on the Table command on the Insert tab in the ribbon (even quicker, use the CTRL+L shortcut key). Clicking the Table command brings up a dialog box where you specify the range for your table, and indicate if your data already contains a header row.
用鼠標(biāo)點擊Ribbon上的Insert標(biāo)簽中的Table就可以生產(chǎn)一個列表(如果希望更快,可以直接使用快捷鍵 <CTRL+L>),此時系統(tǒng)將出現(xiàn)一下對話框,用戶可以指定工作表中的某個區(qū)域為列表,并聲明數(shù)據(jù)是否包含標(biāo)題行。
When you create a table, a new tab appears on the ribbon that is specifically designed for tables. The tab only appears when the active cell is inside a table. The tab contains options and settings that are geared for tables. I won't go into the details right now, but here's a screenshot.
當(dāng)用戶生成列表時,一個新的專門用于設(shè)計列表的標(biāo)簽將出現(xiàn)在Ribbon上,只有當(dāng)前活動單元格位于列表中才可以看到這個標(biāo)簽,該標(biāo)簽可以用來調(diào)整列表的可選項和設(shè)置。我們不在此詳細解釋其全部功能,僅提供界面的截屏。
Another bit of work that we did was to merge our table feature with the existing external data query functionality, sometimes referred to as query table. New queries will therefore also benefit from the features of tables (at the moment, web queries and text queries are excluded from this). I think the benefit of making query tables into tables will become clear over the next week or two as I go over the capabilities of Excel 12 tables. Note, if you have an existing query, you can convert it to a table using the Ribbon or keyboard shortcuts described above. Tables are also created when you import XML data using the XML features we added in Excel 2003.
另外一個改進是我們將現(xiàn)在的外部數(shù)據(jù)查詢(有時也稱為查詢表)融入新的列表功能,新的查詢功能由于引入列表功能而得到加強(同時網(wǎng)站查詢和文本查詢功能將取消),在接下來的一兩周中即將對Excel 12性能進行最終審查,我認(rèn)為屆時查詢表融入列表功能的好處將顯而易見。注意:用戶可以使用上面講到的Ribbon或者快捷鍵將現(xiàn)在在用的查詢表轉(zhuǎn)換為列表,當(dāng)使用Excel2003新增加的XML功能導(dǎo)入XML數(shù)據(jù)時也將生成列表。
Entering Data into a Table
在列表中輸入數(shù)據(jù)
We already saw in the example above how to add a new row to a table. Adding a new column works the exact same way. Place the active cell just outside the table to the right, enter a value and Excel will automatically grow the table to consume the data that you entered. If this isn't the desired result, then a simple command will shrink the table back and leave the value outside the table. This “auto-expand“ behavior can also be turned off.
由上面的示例我們已經(jīng)知道如何在列表中添加新的一行,使用類似的方法可以添加新的一列,將活動單元格設(shè)置在列表的右側(cè),輸入數(shù)據(jù),Excel將自動擴大列表,使其包含新輸入的數(shù)據(jù),如果用戶并不想將新的數(shù)據(jù)添加到列表,一個簡單的操作就可以將列表恢復(fù)原狀,新添加的數(shù)據(jù)將保留在列表外。“自動擴展”功能可以設(shè)置為關(guān)閉。
There are a couple other ways to add rows. Much like tables in Word, pressing TAB when the active cell is in the last column of the last row will cause Excel to add a new row and move the active cell to the first column of the newly added row. In addition, pressing ENTER when the active cell is in any cell of the last row will also cause a new row to be added.
還有幾種方法可以添加行,有些像Word中的表格,當(dāng)活動單元格為列表的右下角單元格,此時按<Tab>鍵,Excel就為列表添加新的一行,并且活動單元格移到新添加行的第一列,另外,當(dāng)活動單元格位于最后一行的任何單元格,按下<Enter>鍵,Excel都將添加新的一行。
Finally, if you want a quick way to resize your table to add or subtract rows or columns, click the resize handle in the lower-right corner of the table and drag it in the direction desired. You can spot the resize handle in the screen shots above.
最后,如果用戶需要快速的調(diào)整列表的大小,也就是添加或者刪除行和列,點擊右下角的“resize”,然后根據(jù)需要拖動就可以調(diào)整列表的大小了。你可以從上圖中看“resize”。
One of the goals of the table feature is to maintain the integrity of your tabular structure, so the only way to shift cells or create space in a table is to add or insert entire table rows or entire table columns.
列表功能的一個目標(biāo)就是保持表格結(jié)構(gòu)的完整性,所以在列表中移動單元格或者添加空白的唯一方法就是添加、插入整行或者整列。
By the way, some of this may look familiar if you've ever used the list feature in Excel 2003. The table feature is in fact based off lists, but as you'll see over the next few days we've built a much more comprehensive feature set around tables.
順便說一下,如果你曾經(jīng)使用過Excel 2003的相關(guān)功能,那么你會熟悉上面的某些操作,事實上列表功能并不是基于以前的功能,接下來的幾天你就可以看到,我們圍繞列表功能可以實現(xiàn)更復(fù)雜的功能。
Over the next few days I plan to show you:
接下來的幾天,我計劃向大家展示下面的內(nèi)容:
· More of the core features of tables
更多的列表核心功能
· The great things that happen when tables and formulas collide
如何處理列表和公式的沖突
· Filtering table data & AutoFilter improvements
列表篩選和自動篩選的改善
· Table Styles and smart formatting behaviors
列表風(fēng)格和智能格式化