对于SHEET2中的每个用户,如何计算SHEET1上COL1中出现“x”的次数?我试过COUNTIF,但我不知道如何使用相对引用,或者甚至可能。
SHEET1
if(command === 'admin') {
if(message.member.roles.find("name", "Owner")){
var ServerExists = false;
for(var ServerId; ServerId<Admins.length; ServerId++) {
if(Admins[ServerId] === message.member.server.id) {
ServerExists = true;
}
}
if(ServerExists === false) {
var NewServer = Admins[Admins.length + 1]
NewServer = {};
}
for(var ServerId; ServerId<Admins.length; ServerId++) {
if(Admins[ServerId] === message.member.server.id) {
var ServerNumber = ServerId
}
}
var ServerAdmins = Admins[ServerNumber]
if(ServerAdmins[1]) {
ServerAdmins[1] = message.member.server.id;
} else {
ServerAdmins[ServerAdmins.length + 1] = message.member.server.id;
message.reply(`${ServerAdmins[ServerAdmins.length]} was added.`)
}
}
SHEET2:
USER COL1
user_a x
user_a
user_b
user_b
user_c x
user_c x