offset函数的使用方法_有点麻烦:使用Excel OFFSET函数
offset函數(shù)的使用方法
That's my dad in the picture, proudly holding the catch of the day. He tried to teach me how to fish, but without much success. (Worms...ewwww.)
那是照片中的我父親,驕傲地拿著當(dāng)天的收獲。 他試圖教我如何釣魚,但沒有成功。 (蠕蟲... ewwww。)
This week someone asked me to explain the Excel OFFSET function, saying "Please teach me to fish." That's when it struck me that using OFFSET is similar to fishing.
本周有人要求我解釋Excel OFFSET函數(shù),說“請教我釣魚”。 那就是讓我驚訝的是,使用OFFSET類似于釣魚。
- When you're fishing, you can dip into a pond with a bamboo pole and a small hook, or head out to sea, and cast a large net. Or you can fish the way we do in Canada, through a small hole in the ice, but that's another story. (There's a video at the end of this article.) 釣魚時(shí),您可以浸入帶有竹竿和小鉤子的池塘中,或者出海捕魚,然后撒網(wǎng)。 或者您可以通過在冰上的一個(gè)小洞釣魚,就像我們在加拿大所做的那樣,但這是另一回事了。 (本文結(jié)尾處有一個(gè)視頻。)
- With the Excel OFFSET function, you can pull data from a single cell nearby, or a large range of cells off in the distance. 使用Excel OFFSET功能,您可以從附近的一個(gè)單元格中提取數(shù)據(jù),也可以從遠(yuǎn)處的較大范圍的單元格中提取數(shù)據(jù)。
The OFFSET function is useful when you want to make the data selection adjustable.
當(dāng)您想使數(shù)據(jù)選擇可調(diào)時(shí),OFFSET功能非常有用。
For example, if a February date is entered in cell A2, you can sum the February expense column. If a March date is entered, sum the March expenses instead.
例如,如果在單元格A2中輸入2月日期,則可以對2月費(fèi)用列進(jìn)行求和。 如果輸入了3月的日期,則應(yīng)將3月的費(fèi)用相加。
您的捕魚設(shè)備 (Your Fishing Equipment)
To make the OFFSET function work, you'll tell it 3 things:
為了使OFFSET函數(shù)起作用,您將告訴它三件事:
The OFFSET syntax is: OFFSET(reference,rows,cols,height,width)
的OFFSET語法是:OFFSET( 參考 , 行 ,COLS,高度,寬度)
The reference is the starting point.
參考是起點(diǎn)。
The rows and cols tell OFFSET where to go from the starting point. It can go up or down a specific number of rows, and left or right a specific number of columns.
該行和cols告訴OFFSET從哪里出發(fā)點(diǎn)去。 它可以在特定數(shù)量的行上向上或向下移動(dòng),并在特定數(shù)量的列上向左或向右移動(dòng)。
The height and width set the size of the range. It can be as small as 1 row and 1 column (a single cell) or much bigger.
高度和寬度設(shè)置范圍的大小。 它可以小至1行1列(單個(gè)單元格),也可以大得多。
For example, this OFFSET formula would return the January total, in cell B6: =OFFSET(A1,5,1,1,1)
例如,此OFFSET公式將在單元格B6中返回一月總計(jì): = OFFSET(A1,5,1,1,1)
誘餌鉤 (Baiting the Hook)
Instead of typing all the values in the formula, you can use one or more cell references, to make the OFFSET formula flexible. In this example, all the totals are in row 5, so that number won't change.
您可以使用一個(gè)或多個(gè)單元格引用來代替OFFSET公式中的所有值,以使OFFSET公式更靈活。 在此示例中,所有總計(jì)都在第5行中,因此該數(shù)字不會(huì)更改。
However, the month number is typed in cell G1, so you could use that cell to set the number of columns to offset. Change the formula so G1 is the cols argument.
但是,月份號是在單元格G1中鍵入的,因此您可以使用該單元格來設(shè)置要偏移的列數(shù)。 更改公式,使G1為cols參數(shù)。
=OFFSET(A1,5,G1,1,1)
=偏移(A1,5,G1,1,1)
Now, if you change the month number to 3 in cell G1, the March total will be returned.
現(xiàn)在,如果您在單元格G1中將月份號更改為3,則將返回三月份的總數(shù)。
鑄造網(wǎng) (Casting the Net)
Instead of pulling the result from a single cell, you could use OFFSET with the SUM function, to select a range with multiple cells, and calculate the total.
您可以將OFFSET與SUM函數(shù)結(jié)合使用,而不是從單個(gè)單元格中提取結(jié)果,而是選擇包含多個(gè)單元格的范圍并計(jì)算總和。
For example, this formula would calculate the total for the February expenses.
例如,此公式將計(jì)算2月費(fèi)用的總額。
=SUM(OFFSET(A1,1,G1,4,1))
= SUM(OFFSET(A1,1,G1,4,1))
其他炸魚 (Other Fish to Fry)
I like the OFFSET function, and use it to create dynamic ranges in some of my workbooks. There are alternatives to using the Excel OFFSET function, such as the Excel INDEX Function.
我喜歡OFFSET函數(shù),并用它在某些工作簿中創(chuàng)建動(dòng)態(tài)范圍 。 除了使用Excel OFFSET函數(shù)外,還有其他選擇,例如Excel INDEX函數(shù) 。
There's an interesting discussion of the merits of each function on Dick Kusleika's Daily Dose of Excel Blog: New Year's Resolution: No More Offset.
在Dick Kusleika的Excel博客每日劑量: 新年決議:不再有偏移上,有一個(gè)有趣的討論,關(guān)于每個(gè)函數(shù)的優(yōu)點(diǎn)。
冰冷魚 (Ice Cold Fish)
I'd rather stay inside and work on OFFSET formulas, but ice fishing is popular here in Canada. This video makes the sport look almost appealing.
我寧愿呆在里面并研究抵消公式,但在加拿大,冰釣很流行。 該視頻使這項(xiàng)運(yùn)動(dòng)看起來很吸引人。
演示地址
翻譯自: https://contexturesblog.com/archives/2010/01/20/something-fishy-using-the-excel-offset-function/
offset函數(shù)的使用方法
總結(jié)
以上是生活随笔為你收集整理的offset函数的使用方法_有点麻烦:使用Excel OFFSET函数的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C9800系列思科无线控制器
- 下一篇: 【无标题】Unity随手记——给Scen