简体   繁体   English

在一列中查找名称,从另一列返回值

[英]Find name in one column, return value from another

I have a spreadsheet with responses from a Google Form.我有一个包含来自 Google 表单的回复的电子表格。 They sign up for one of our trivia games, then I make a spreadsheet for each game.他们注册了我们的一个琐事游戏,然后我为每个游戏制作了一个电子表格。 I wrote a FILTER function in the corresponding Google Sheet that gives me a list of all the players' names.我在相应的 Google 表格中写了一个 FILTER function,它给了我所有玩家姓名的列表。

What I need is a function to reference the team name from the Responses sheet and give me the information in my filtered game sheet.我需要一个 function 来引用响应表中的团队名称,并在过滤后的游戏表中给我信息。 I would like a function rather than a Javascript script to run manually.我希望手动运行 function 而不是 Javascript 脚本。 I am certain this can be done but the function methodology is escaping me.我确信这可以做到,但 function 方法是 escaping 我。

As an example, I have created a spreadsheet in Google Sheets with some data.例如,我在 Google 表格中创建了一个包含一些数据的电子表格。 Can someone help me write a formula to put team names in "The Office" tab?有人可以帮我写一个公式将团队名称放在“办公室”选项卡中吗? Thanks in advance.提前致谢。

https://docs.google.com/spreadsheets/d/1F2bgvHXqA2wNUa98rfESWTeK22va1RMQUjnk6ma2AeA/edit?usp=sharing https://docs.google.com/spreadsheets/d/1F2bgvHXqA2wNUa98rfESWTeK22va1RMQUjnk6ma2AeA/edit?usp=sharing

In B2 try this formula在 B2 中尝试这个公式

=ArrayFormula(if(len(A2:A), vlookup( match("*"&A2:A&"*", 'Form Responses'!C:C, 0), {row('Form Responses'!A:A), 'Form Responses'!B:B}, 2, 0),))

and see if that helps?看看这是否有帮助?

Looks like you need a VLOOKUP which grabs the value of the matching row of whatever criteria you specify.看起来您需要一个 VLOOKUP 来获取您指定的任何条件的匹配行的值。 The only issue was that VLOOKUP requires the column of values being returned to be after the "lookup column" which meant moving the team names column to column D.唯一的问题是 VLOOKUP 要求返回的值列位于“查找列”之后,这意味着将团队名称列移动到 D 列。

Here is the formula: =VLOOKUP("*"&A2&"*",'Form Responses':C$2,D$23,2, FALSE)这是公式: =VLOOKUP("*"&A2&"*",'Form Responses':C$2,D$23,2, FALSE)

I also went ahead and implemented it in your linked spreadsheet.我还继续在您的链接电子表格中实现了它。

use in B2:在 B2 中使用:

=ARRAYFORMULA(IF(A2:A="",,IFNA(VLOOKUP("*"&A2:A&"*", 'Form Responses'!C2:D, 2, 0))))

0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从另一个工作表中按谷歌工作表中的列名返回值 - Return value by column name in google sheets from another sheet 从一列中返回与另一列中定义的值匹配的选定值 - Return selected values from one column matching a defined value in another column PostgreSQL:在多个列中找到最小值但返回列名 - PostgreSQL: find minimum value across multiple columns but return column name 将返回值从一个数组传递到另一个数组 - Passing a return value from one array to another array 将数组值从一个 Perl 脚本返回到另一个 Perl 脚本 - Return array value from one Perl script to another Perl script 比较 2 arrays 并从一个数组到另一个数组查找属性值 - Compare 2 arrays and find an attribute's value from one array to another 查找从一个SAS表到另一表的最近值 - Find Closest Value from one SAS table to another 如何从一个数组中获取代码并从另一个数组中查找值并返回新值 - How to take a code from one array and lookup a value from another array and return the new value Excel VBA 从数组的单元格中查找值并将值返回到新列 - Excel VBA Find a value within a cell from an array and return value to new column 搜索具有特定列值的数组行并从符合条件的行返回另一个值 - Search for array row with specific column value and return another value from qualifying row
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM