[英](google sheets or excel) How can I find the closest matching value above the current cell, and return a different column in that same row?
I asked this question here , but I've hit another roadblock.我在这里问了这个问题,但我遇到了另一个障碍。 I've included a visual below of what I'm trying to achieve.
我在下面包含了我要实现的目标的视觉效果。
For any row where Column A=x, just return the value in Column B to Column "Results".对于 A 列 = x 的任何行,只需将 B 列中的值返回到“结果”列。 If Column A does not equal x, I want to return the closest (in distance) Column B value above the current row where Column A=x and Column B is any 3 digit number.
如果 A 列不等于 x,我想返回当前行上方最近(距离)的 B 列值,其中 A 列 = x,B 列是任何 3 位数字。 The first part (where Column A=x) is simple, but I'm having trouble with the second part, where Column A <> x.
第一部分(列 A=x)很简单,但我在第二部分遇到问题,列 A <> x。 In the linked question, I was able to use the solution to find the closest value above the current cell where Column A=x, but I have not been able to figure out how to find the closest value above the current cell where Column A=x AND Column B is any 3 digit number.
在链接的问题中,我能够使用该解决方案找到列 A=x 的当前单元格上方的最接近值,但我无法弄清楚如何找到列 A= 的当前单元格上方的最接近值x AND B 列是任意 3 位数字。 Any suggestions would be much appreciated!
我们欢迎所有的建议! Thank you!
谢谢!
try:尝试:
=INDEX(IF(B:B="",, VLOOKUP(ROW(B:B),
IF(ISNUMBER(1*B:B)*(LEN(B:B)=3), {ROW(B:B), B:B}), 2, 1)))
ISNUMBER
will check for the digits and LEN
will check for 3 numbers ISNUMBER
将检查数字, LEN
将检查 3 个数字
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.