用于过滤搜索和与单元格进行比较的公式

时间:2018-04-29 21:39:58

标签: excel google-sheets spreadsheet

我想在Google表格中自动完成一项任务(因为手动完成这项任务非常繁琐且耗费时间)。

    A     B       C       D       E       F       G       H       I       J   
01 A00  D1 4F   F6 24   C8 BD   4F 75   9E 7D   E7 53   98 6C   9F EC   4E C4
02 A01  C5 8F   8E 68   E5 39   7D 41   36 6B   38 3D   99 54   61 83   C6 42
03 A02  72 F4   99 CA   91 C1   1E 58   25 3A   96 33   91 4E   FC 87   70 1C
04 A03  65 11   17 82   78 3F   56 18   23 77   2F B3   4A B0   67 FF   66 1B
05 A04  D4 BA   D8 58   F5 3A   DA 21   32 43   03 95   94 18   78 76   68 53
06 A05  1D ED   7D 41   86 BB   A4 07   CC 00   5F 17   BB 7D   B3 30   28 C8
07 A06  98 97   EF 9A   85 53   E5 A9   8D 3A   C7 6C   8D D0   44 FF   1C 4C
08 A07  8F 26   E1 BB   88 46   74 46   42 0F   E2 B7   4D 5C   34 F0   4A C5
09 A08  AD FD   61 93   EF 9F   50 7A   10 24   65 6D   2F 2D   BF F4   45 1B
10 A09  5A 5F   A2 93   A6 F6   76 DB   D5 FE   3F 33   28 3E   3E F9   F5 8F
11 A10  B3 30   07 7E   9A AA   70 AB   78 63   16 E4   23 E4   93 3B   BA 28
12 A11  24 A6   DA 5F   15 CC   E4 F3   AB 18   4B FE   EB 2E   2D 74   9A AC
13 A12  C4 0D   22 54   DA 9F   8A 69   A8 B3   44 2B   91 C1   7D 41   40 17
14 A13  01 1E   BA FC   27 89   71 5A   1B BF   B3 01   E4 73   A3 9F   DE 24
15 A14  6E D7   71 8F   44 B6   4C 16   95 A6   BF C6   21 B9   D0 48   08 DA
16 A15  79 F2   E7 53   D9 4D   3D B4   3B 7E   9D 80   25 EB   7F 0B   43 33  

如果我搜索一个值(例如" 67 FF"),首先我想显示与搜索原始对应的A列的值(在这个例子中:" 67 FF" => I4 => A4 =>" A03")。
其次,我想显示(在另一个单元格中)与B1单元相比的列数和原始数(表垂直循环)(在同一示例中:" 67 FF" => I4 = > 3 raws& 7 columns)。
但是,如果有多个结果,我想显示最接近B1的值(表垂直循环) 其他例子:
"E7 53" => G1 ; C16 => C16 => A16 => "A15" / 1 raw & 1 column
"7D 41" => E2 ; C6 ; I13 => E2 => A2 => "A01" / 1 raw & 3 columns
"B3 30" => I6 ; B11 => B11 => A11 => "A10" / 6 raws & 0 column

1 个答案:

答案 0 :(得分:0)

我希望回答还为时不晚。不过,请检查google-sheet-lookup-value-in-2d-range。 电子表格包含通过水平和垂直循环来查找值的公式。


formula to lookup value by looping vertically:

=ifs(
NOT(ISERROR(MATCH(A29,$B$1:$J$1,0))),MATCH(A29,$B$1:$J$1,0)+1&","&1,
NOT(ISERROR(MATCH(A29,$B$2:$J$2,0))),MATCH(A29,$B$2:$J$2,0)+1&","&2,
NOT(ISERROR(MATCH(A29,$B$3:$J$3,0))),MATCH(A29,$B$3:$J$3,0)+1&","&3,
NOT(ISERROR(MATCH(A29,$B$4:$J$4,0))),MATCH(A29,$B$4:$J$4,0)+1&","&4,
NOT(ISERROR(MATCH(A29,$B$5:$J$5,0))),MATCH(A29,$B$5:$J$5,0)+1&","&5,
NOT(ISERROR(MATCH(A29,$B$6:$J$6,0))),MATCH(A29,$B$6:$J$6,0)+1&","&6,
NOT(ISERROR(MATCH(A29,$B$7:$J$7,0))),MATCH(A29,$B$7:$J$7,0)+1&","&7,
NOT(ISERROR(MATCH(A29,$B$8:$J$8,0))),MATCH(A29,$B$8:$J$8,0)+1&","&8,
NOT(ISERROR(MATCH(A29,$B$9:$J$9,0))),MATCH(A29,$B$9:$J$9,0)+1&","&9,
NOT(ISERROR(MATCH(A29,$B$10:$J$10,0))),MATCH(A29,$B$10:$J$10,0)+1&","&10,
NOT(ISERROR(MATCH(A29,$B$11:$J$12,0))),MATCH(A29,$B$11:$J$11,0)+1&","&11,
NOT(ISERROR(MATCH(A29,$B$12:$J$13,0))),MATCH(A29,$B$12:$J$12,0)+1&","&12,
NOT(ISERROR(MATCH(A29,$B$13:$J$13,0))),MATCH(A29,$B$13:$J$13,0)+1&","&13,
NOT(ISERROR(MATCH(A29,$B$14:$J$14,0))),MATCH(A29,$B$14:$J$14,0)+1&","&14,
NOT(ISERROR(MATCH(A29,$B$15:$J$15,0))),MATCH(A29,$B$15:$J$15,0)+1&","&15,
NOT(ISERROR(MATCH(A29,$B$16:$J$16,0))),MATCH(A29,$B$16:$J$16,0)+1&","&16
)



lookup value in 2d range