简体   繁体   English

在vlookup公式中使用单元格值

[英]Use cell value in vlookup formula

=vlookup(c2,code1,2,false)

I am using the vlookup code but I would like to use the cell value in 'c2' rather than c2 itself. 我正在使用vlookup代码,但我想在'c2'中使用单元格值,而不是c2本身。 The value within this cell will change, at the moment it is 'aj2'. 此单元格中的值将立即更改为“ aj2”。 Is there an easy way of doing this? 有一个简单的方法吗?

Hi Thanks, that doesn't seem to work for what I want. 嗨,谢谢,这似乎不适用于我想要的东西。 I suppose it might be easier if I explain what I want to do eventually. 我想如果我最终解释一下我想做什么,可能会更容易。 I would like to be able to type in a column reference ie B (excluding the cell row). 我希望能够输入列引用,即B(不包括单元格行)。

Sheet1 (Input column reference) Sheet1 (输入列参考)

AB AB
Code1- B (this cell value will change) Code1- B (此单元格值将更改)

Sheet2 (Name reference 'code1') Sheet2 (名称参考为“ code1”)

AB AB
Pre Start -1 开始前-1
Established-2 成立-2

Sheet3 (Data pasted from another file-this data will change) Sheet3 (从另一个文件粘贴的数据-该数据将更改)

ABC ABC
1-Pre Start- =vlookup (Show '1' from the code1) 2-Established- =vlookup (Show '2' from the code1) 1-Pre开始-= vlookup(从代码1显示'1')2-建立的-= vlookup(从代码1显示'2')
3-Established- =vlookup (Show '2' from the code1) 3已建立-= vlookup(从代码1中显示“ 2”)
4-Pre Start- =vlookup (Show '1' from the code1) 5-Pre Start- =vlookup (Show '1' from the code1) 4-Pre Start- = vlookup(从代码1显示'1')5-Pre Start- = vlookup(从代码1显示'1')

=VLOOKUP(INDIRECT(c2),code1,2,false)

Here you miss INDIRECT:- You Can use this and may help you 在这里,您会错过INDIRECT:-您可以使用此功能,可能会对您有所帮助

=VLOOKUP(INDIRECT(C2), code1, 2, 0) = VLOOKUP(INDIRECT(C2),代码1,2,0)

您可以使用=INDIRECT

=VLOOKUP(INDIRECT(C2), code1, 2, FALSE)

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

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