English 中文(简体)
在谷歌谢物的一栏中找到最后一个非致命的电池
原标题:Get the last non-empty cell in a column in Google Sheets

我使用以下职能:

=DAYS360(A2, A35)

页: 1 然而,该栏在不断扩大,在我更新我的电子表格时,我现在不得不人工改动A35。

是否有办法(在谷歌谢茨)在这个栏目中找到最后的无能为力的囚室,然后动态地将这一参数确定在上述功能中?

最佳回答

There may be a more eloquent way, but this is the way I came up with:

The function to find the last populated cell in a column is:

=INDEX( FILTER( A:A ; NOT( ISBLANK( A:A ) ) ) ; ROWS( FILTER( A:A ; NOT( ISBLANK( A:A ) ) ) ) )

So if you combine it with your current function it would look like this:

=DAYS360(A2,INDEX( FILTER( A:A ; NOT( ISBLANK( A:A ) ) ) ; ROWS( FILTER( A:A ; NOT( ISBLANK( A:A ) ) ) ) ))
问题回答

为找到最后的豁免小组,您可使用INDEX>>> :MATCH。 职能如下:

=DAYS360(A2; INDEX(A:A; MATCH(99^99;A:A; 1)))

我认为,这几乎是更快和容易的。

如果A2:A含有连续日期,那么INDEX(A2:A,COUNT(A2:A)将返回最后日期。 最后公式是

=DAYS360(A2,INDEX(A2:A,COUNT(A2:A)))

我投赞成票:

=INDEX(A2:A,COUNTA(A2:A),1)

因此,对于OP的需要:

=DAYS360(A2,INDEX(A2:A,COUNTA(A2:A),1))

If the column expanded only by contiguously added dates as in my case - I used just MAX function to get last date.

最后公式是:

=DAYS360(A2; MAX(A2:A)) 

这里指的是:

=indirect("A"&max(arrayformula(if(A:A<>"",row(A:A),""))))

最后是:

=DAYS360(A2,indirect("A"&max(arrayformula(if(A:A<>"",row(A:A),"")))))

这里工作的另一个方程式是这样,但我喜欢这样一来,因为它使人数变得容易,我认为我需要做更多的工作。 仅仅这样说:

=max(arrayformula(if(A:A<>"",row(A:A),"")))

我最初试图找到解决办法,解决一个电子表格问题,但找不到任何用处,只是给最后入境次数增加,因此,希望这对一个人有益。

此外,这还具有额外优势,即它能够按任何顺序为任何类型的数据服务,而且你可以在有内容的浏览器之间有空白的浏览器,并且用“评价”的公式计算电池。 它还可以处理重复的价值观。 所有这一切都与此处使用最大(G:G<>”*row(G:G)的公式非常相似,但如果把增长数推向你们之后,则会稍加容易。

Alternatively, if you want to put a script on your sheet you can make it easy on yourself if you plan on doing this a lot. Here s that scirpt:

function lastRow(sheet,column) {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  if (column == null) {
    if (sheet != null) {
       var sheet = ss.getSheetByName(sheet);
    } else {
      var sheet = ss.getActiveSheet();
    }
    return sheet.getLastRow();
  } else {
    var sheet = ss.getSheetByName(sheet);
    var lastRow = sheet.getLastRow();
    var array = sheet.getRange(column + 1 +  :  + column + lastRow).getValues();
    for (i=0;i<array.length;i++) {
      if (array[i] !=   ) {       
        var final = i + 1;
      }
    }
    if (final != null) {
      return final;
    } else {
      return 0;
    }
  }
}

如果您希望把最后一行放在你目前重新编辑的同一页上的话,你可以这样做:

=LASTROW()

or if you want the last row of a particular column from that sheet, or of a particular column from another sheet you can do the following:

=LASTROW("Sheet1","A")

And for the last row of a particular sheet in general:

=LASTROW("Sheet1")

然后获得实际数据。

=INDIRECT("A"&LASTROW())

或您可在最后两条回归线上修改上述文字(最后两条,因为为了从实际的栏目中获取实际价值,你必须填写表格和栏目),并将变数改为:

return sheet.getRange(column + final).getValue();

and

return sheet.getRange(column + lastRow).getValue();

One benefit of this script is that you can choose if you want to include equations that evaluate to "". If no arguments are added equations evaluating to "" will be counted, but if you specify a sheet and column they will now be counted. Also, there s a lot of flexibility if you re willing to use variations of the script.

Probably overkill, but all possible.

这为我工作。 谷歌中A栏的最后价值:

=index(A:A,max(row(A:A)*(A:A<>"")))

(如果存在的话,也会出现空白段)

This seems like the simplest solution that I ve found to retrieve the last value in an ever-expanding column:

=INDEX(A:A,COUNTA(A:A),1)

严格将最后一批非致命的囚室放在一栏中,这项工作应当做到......

=LOOKUP(2^99, A2:A)

达到最后价值的公式是什么:

=index(G:G;max((G:G<>"")*row(G:G)))

这将是你最初任务的最后公式:

=DAYS360(G10;index(G:G;max((G:G<>"")*row(G:G))))

假设你最初的日期是10国集团。

我走了一条不同的路线。 自2006年以来 我知道,我只想一把东西加进一行/栏,我先点一下有数据的领域。 页: 1

=COUNT(A5:A34)

So, let s say that returned 21. A5 is 4 rows down, so I need to get the 21st position from the 4th row down. I can do this using inderect, like so:

=INDIRECT("A"&COUNT(A5:A34)+4)

它寻找有数据的浏览量,并以指数变数将我送回一米。

for a row:

=ARRAYFORMULA(INDIRECT("A"&MAX(IF(A:A<>"", ROW(A:A), ))))

for a column:

=ARRAYFORMULA(INDIRECT(ADDRESS(1, MAX(IF(1:1<>"", COLUMN(1:1), )), 4)))

这将使最后一个单元的内容:

=indirect("A"&max(ARRAYFORMULA(row(a:a)*--(a:a<>""))))

这将使最后一个单元的地址:

="A"&max(ARRAYFORMULA(row(a:a)*--(a:a<>"")))

这将使最后一间牢房的囚室:

=max(ARRAYFORMULA(row(a:a)*--(a:a<>"")))

Maybe you d prefer a script. This script is way shorter than the huge one posted above by someone else:

供稿编辑,并拯救这一文字:

function getLastRow(range){
  while(range.length>0 && range[range.length-1][0]==  ) range.pop();
  return range.length;
}

其中一项行动是,你刚刚需要在一个牢房里进入:

=getLastRow(A:A)

With the introduction of LAMBDA and REDUCE functions we can now compute the row number in a single pass through the cells (Several of the solutions above filter the range twice.) and without relying on magic text or numeric values.

=lambda(rng, 
   REDUCE(0, rng, lambda(maxrow, cell, if(isblank(cell),maxrow,row(cell)) ) )
)(A:A)

单装成像使用一样的纳米功能

=LAST_ROWNUM(A:A)

该系统使用间带和多科米宽的栏目(在第一行的距离范围内,再加固),而部分栏(如A20:A),则实际增长数(在幅度内未加抵消)。

This can then be combined with Index to return the value

=DAYS360(A2, Index(A1, LAST_ROWNUM(A:A)))

(In truth, though, I suspect that the OPs date values are monotonic (even if with blanks in between), and that he could get away with

=DAYS360(A2, MAX(A2:A))

This solution is identified above as relying on the dates being "contiguous" - whether that means "no blanks" or "no missing dates" I m not certain - but either stipulation is not necessary.)

找到最后一批非排他性牢房(它们之间的隔)) 页: 1 A

=ArrayFormula(IFNA(match(2,1/(A:A<>""))))

计算A栏最新日期与A2号单元的日期之间的差额。

=MAX(A2:A)-A2

本科林斯是谷歌片灰色素,他在其网站上有许多可供免费使用的课程。 他有关于动态范围名称的免费文章,我把这作为我许多项目的基础。

https://www.benlcollins.com/formula-examples/dynamic-ony-ranges/

Disclaimer, I have nothing to gain by referring Ben s site.

这里是我利用动态幅度的项目之一的屏幕:

enter image description here

D3单元有上述公式,但作为一项阵列公式:

=ArrayFormula(MAX(IF(L2s!A2:A1009<>"",ROW(2:1011))))

D4单元有这一公式:

="L2s!A2:E"&D3

The way an amateur does it is "=CONCATENATE("A",COUNTUNIQUE(A1:A9999))", where A1 is the first cell in the column, and A9999 is farther down that column than I ever expect to have any entries. This resultant A# can be used with the INDIRECT function as needed.

这一工作可以:

www.un.org/Depts/DGACM/index_french.htm

To pick the last in a column of arbitrary, non-empty values ignoring the header cell (A1):

=INDEX(A2:A,COUNT(A2:A))

This worked for me: =ArrayFormula(LOOKUP(2,1/(CELL_RANGE<>""),CELL_RANGE))

仅将你的囚室范围列入 CELL_RANGE

除了单列工作外,还有一行工作。





相关问题
Conditional Formatting in Excel

I m very new to Excel and VBA and was wondering if there is a way I could make conditional formatting based on values in a drop down list (created from data validation). I currently have a warning if ...

excel formula problem

Kindly check the below written formula, if the formula is not correct then please provide me the correct one that is related to this. IF(A1:AV7000=F1,vlookup(f2,B1:C7000,2,0),0) As I have tried ...

Nested IF statements in Excel [Over the 7 allowed limit]

I am trying to create a spreadsheet which automagically gives a grade to a student based on their marks they got. I ve apparently hit Excel s nested IF statement limit which is 7. Here s my if ...

excel function to get value of another cell

Image describing the problem http://img215.imageshack.us/img215/3725/20100314235127schedule2.jpg I hope the image above can explain what I need. :) Problem 1: Get the date where it is the first ...

Excel Match Bug in a Sparse Range with Duplicate Keys

The data in TheRange is {1,"",1,"",1,"",1,"",2}. =Match(2, TheRange, 1) returns 9 as expected. =Match(1.5, TheRange, 1) returns 7 as expected. =Match(1, TheRange, 1) returns 5 which is not expected. ...

热门标签