[英]Formula to pull cell from rightmost column with data (knowing row number)
Is there a formula that I can use to pull a number from the rightmost column with data? 我是否可以使用公式从最右边的数据列中提取数字? The row will never change and length of the column range is already predefined. 该行将永远不会更改,并且列范围的长度已预先定义。 I will just be adding data in each column over time and would like the most recent number to appear in a separate cell. 我将随着时间的推移在每列中添加数据,并且希望最新的数字出现在单独的单元格中。
Thanks, 谢谢,
Yes, you can do that. 是的,你可以这么做。 If you input data in row 1, you can use: 如果在第1行中输入数据,则可以使用:
=INDEX(1:1,MATCH(9^99,1:1,1))
Or 要么
=LOOKUP(9^99,1:1)
To get the most recent number . 要获取最新的号码 。 Those won't work with text, but you can replace 9^99
with zzz
for text. 这些将不适用于文本,但是您可以将9^99
替换为zzz
以用于文本。
If you can have a number larger than the result of 9^99
though, you need to pick a higher number in the above formulae. 但是,如果您的数字可以大于9^99
的结果,则需要在上述公式中选择一个更大的数字。
对于第3行,假设最后一列的数据没有空白:
=INDEX(3:3,1,COUNTA(3:3))
This one works for numbers and strings and ignores blanks. 这个适用于数字和字符串,并且忽略空格。 It's an array formula, so must be entered with ctrl-shift-enter: 这是一个数组公式,因此必须使用ctrl-shift-enter输入:
=INDEX(2:2,MAX((2:2<>"")*(COLUMN(2:2))))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.