简体   繁体   English

发送单元格值作为参数以将其用作vlookup公式的值标准

[英]Send cell value as a parameter to use it as a value criteria for vlookup formula

I have the following as target: 我有以下目标:

源工作簿。

In another workbook, I have as a data source this table: 在另一个工作簿中,我将此表作为数据源:

源文件夹

So, using VLOOKUP formula I'm retrieving the values that I want for the cell just with formulas like that: 因此,使用VLOOKUP公式,仅使用以下公式即可检索所需的单元格值:

=CONSULTAV("user1";login.xlsx!Tabla1[#Datos];2;FALSO

CONSULTAV is the spanish formula for VLOOKUP, so I guess in english (just for better understanding as this is a english website) should be something like: CONSULTAV是VLOOKUP的西班牙语公式,所以我想英语(为了更好地理解,因为这是一个英语网站)应该类似于:

=VLOOKUP("user1";login.xlsx!Table1[#Data];2;FALSE

I want to type in the cell a simpler formula , something like: 我想在单元格中输入一个更简单的公式,例如:

=FindValue("user1")

So that formula calls the VLOOKUP formula and just uses the value as first argument for the VLOOKUP formula for searching the value. 因此,该公式将调用VLOOKUP公式,并且仅将值用作VLOOKUP公式用于搜索值的第一个参数。

Assuming the following data layout, 假设以下数据布局,

在此处输入图片说明

Select B3 and then create a defined name with the following parameters, 选择B3,然后使用以下参数创建一个定义的名称,

在此处输入图片说明

That formula is, 这个公式是

=VLOOKUP("password"&RIGHT(Sheet4!B2, 1), Table1[#All], 2, FALSE)

Now use =FindPassword in B3. 现在在B3中使用=FindPassword

在此处输入图片说明

This method will always find the password associated with the user in the cell directly above it. 此方法将始终在直接位于其上方的单元格中找到与用户关联的密码。

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

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