简体   繁体   English

VLOOKUP如果

[英]VLOOKUP for an If

We want to have a warning system for our server, and we want it to lookup a unique SteamID to look for any warnings that have previously been given, the spreadsheet looks similar to this: 我们希望为我们的服务器提供一个警告系统,并且希望它查找一个唯一的SteamID来查找以前已给出的任何警告,电子表格看起来类似于以下内容:

PlayerName   Reason  StaffMemb  WarningNumber  SteamID

Like I said, I want it to search for the STEAMID in the final column and then see what the warning number is, and if another one has been given through the form, that it is to automatically add another warning to the total on WarningNumber 就像我说的那样,我希望它在最后一列中搜索STEAMID,然后查看警告编号是什么,如果通过该表单给出了另一个警告编号,则它将自动在警告编号的总数中添加另一个警告

assuming PlayerName is in column A and SteamID is in D 假设PlayerName在A列中,而SteamID在D列中

assuming that warning numbers are unique and that there is just 1 SteamID per column, and that the SteamID you want to lookup is in F1 then 假设警告号是唯一的,并且每列只有1个SteamID,并且要查找的SteamID在F1中,则

=Index(D:D,match(F1,E:E,0))

This will return the first Warning number. 这将返回第一个警告编号。 if you want to find reason or/and player name just create another cell and change index(D:D to whatever column you want to return. 如果要查找原因或/和玩家名称,只需创建另一个单元格并将index(D:D更改为要返回的任何列。

HOWEVER: 然而:

if there are multiple warning numbers per SteamID, and the only reason a SteamID is in the table is due to a warning (ie no warning no SteamID listed in table) perhaps a count feature is better (lets you know the severity and repetitiveness of the offender) 如果每个SteamID有多个警告编号,并且表中存在SteamID的唯一原因是由于警告(即,表中未列出警告,则没有警告),则计数功能可能更好(让您知道警告的严重性和重复性)罪犯)

=Countif(E:E,F1)

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

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