简体   繁体   English

excel和机械特克

[英]excel and mechanical turk

I am trying to search for identical strings in different columns and cells of the same excel worksheet. 我正在尝试在同一Excel工作表的不同列和单元格中搜索相同的字符串。 Specifically, i am trying to use it to approve people for mechanical turk. 具体来说,我正在尝试使用它来批准人们使用机械特克。 I copy and paste a list of people's MTurk ID's into the downloaded CSV file (from mechanical turk) that I use to approve people. 我将人们的MTurk ID列表复制并粘贴到下载的CSV文件(来自机械土耳其人)中,该文件用于批准人们。 So I add two columns at the end of this downloaded csv file, they are Mturk ID and 1 or 0, indicating whether they should be approved. 因此,我在下载的csv文件的末尾添加了两列,分别是Mturk ID和1或0,指示是否应批准它们。 I am trying to write a function that will search the two columns that contain all MTurk ID's, then look if there is 1 or 0 next to the ID, thereby indicating whether they should be approved or not. 我正在尝试编写一个函数,该函数将搜索包含所有MTurk ID的两列,然后查看ID旁边是否有1或0,从而指示是否应批准它们。 Can someone please help me?? 有人可以帮帮我吗?? I assume this can be done with an IF statement. 我认为这可以通过IF语句完成。 I am not familiar with VBA, unfortunately. 不幸的是,我对VBA不熟悉。

It sounds like you need a Vlookup function to lookup the 1 or 0 from your list of IDs. 听起来您需要一个Vlookup函数才能从ID列表中查找1或0。 The way a vlookup works is it looks up a certain value (like mechanical turk id) in a range of data and returns any piece of data on the same row as the found match. vlookup的工作方式是在一定范围的数据中查找某个值(例如机械特克ID),并在找到的匹配项所在的同一行上返回任何数据。

As an example, if you had your data in some set of cells, let's say column A had MTurkId, column B had last name, C first name, and so on, and you had your lookup ids and 0 and 1s in the range of cells from T1 to U10 (say a list of 10 ids just for example's sake), you could insert a vlookup in a column to the right of your data (let's say column D in this example). 例如,如果您将数据存储在某些单元格集中,则假设列A具有MTurkId,列B具有姓氏,C名字等等,并且您的查找ID以及0和1在范围内从T1到U10的单元格(例如,仅列出10个ID),您可以在数据右侧的列中插入vlookup(在此示例中为D列)。 It would look like: 它看起来像:

=vlookup(A1, T1:U10, 2, false)

The first parameter is the value you want to look up (the mechanical turk id). 第一个参数是您要查找的值(机械土耳其人ID)。 The second is the range in which you want to look up the id--the potential matching IDs would have to be in column T--the first column in the range you identify, and column U would have to be your 0 or 1. The 2 tells it you want to return the second column in the range of data, which in this case is the 0 or 1 in column U. The false tells it you want an exact and not an approximate match (I've never found a reason to use the approximate match, so I just always use false here). 第二个是您要查找ID的范围-潜在的匹配ID必须在T列中-您确定范围的第一列,而U列则必须是0或1。 2告诉您要返回数据范围中的第二列,在这种情况下,该列为U列中的0或1。false告诉您要精确而不是近似匹配(我从未找到过使用近似匹配的原因,因此我总是在这里使用false)。

If this doesn't make sense, Google the vlookup, and you should find a lot of examples and more information. 如果这没有意义,请使用Google vlookup,您应该找到很多示例和更多信息。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM