如何获取Google Spreadsheet中最后一个非空字段的第二个和第二个字段? [英] How to get the last and second from last non-empty field in Google Spreadsheet?

查看:215
本文介绍了如何获取Google Spreadsheet中最后一个非空字段的第二个和第二个字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



=((Z $ 39-Z $ 38)/ Z $ 38 * 100)



Z列包含数字数据。

每次我更新电子表格时,我都会向Z列添加一个新行,并且必须用新单元格更新上述公式。例如,下个月我必须更新它:

=((Z $ 40-Z $ 39)/ Z $ 39 * 100)



如何更改此公式以自动查找Z列中的最后一个单元格,以及Google Spreadsheets中最后一个单元格的第二个单元格?感谢!

解决方案

您可以使用INDEX / MATCH:

  =((INDEX(Z:Z,MATCH(1E + 99,Z:Z)) -  INDEX(Z:Z,MATCH(1E + 99,Z:Z)-1))/ INDEX(Z:Z,MATCH(1E + 99,Z:Z)-1)* 100)

INDEX(Z:Z,MATCH(1E + 99,Z:Z))会找到列Z中最后一个单元格。

b

通过在MATCH之后放置一个-1,它将把值从第二个拉到最后一个。
$ b


The current formula in my spreadsheet is the following:

=((Z$39-Z$38)/Z$38*100)

The Z column contains numerical data.

Each time I update the spreadsheet I add a new row to column Z and have to update the above formula with the new cell. For example, next month I'll have to update it to:

=((Z$40-Z$39)/Z$39*100)

How do I change this formula to automatically find the last cell in column Z AND the second from last cell in Google Spreadsheets? Thanks!

解决方案

You can use INDEX/MATCH:

=((INDEX(Z:Z,MATCH(1E+99,Z:Z))-INDEX(Z:Z,MATCH(1E+99,Z:Z)-1))/INDEX(Z:Z,MATCH(1E+99,Z:Z)-1)*100)

INDEX(Z:Z,MATCH(1E+99,Z:Z)) will find the last cell in Column Z with a number.

By putting a -1 after the MATCH it will pull the value from the second to last.

这篇关于如何获取Google Spreadsheet中最后一个非空字段的第二个和第二个字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆