简体   繁体   English

使用VLOOKUP数据输入公式

[英]Using VLOOKUP data to feed into a formula

In my chart, I have a VLOOKUP formula in COLUMN B and COLUMN D to populate the brand and room count . 在我的图表中,我在B栏和D栏中有一个VLOOKUP公式,以填充品牌房间数 These are reference points for the the returned number formula in COLUMN E. Since COLUMN B and COLUMN D are using VLOOKUP, it doesn't allow the formula in column E to work unless manually entered. 这些是COLUMN E中返回的数字公式的参考点。由于COLUMN B和COLUMN D使用VLOOKUP,因此除非手动输入,否则E列中的公式无法使用。 Is there a way around this? 有没有解决的办法?

Here's the formula for COLUMN B: =VLOOKUP($A2,'SS File 2019Feb13'!$C$1:$DH$4095,3,0) 这是列B的公式:= VLOOKUP($ A2,'SS File 2019Feb13'!$ C $ 1:$ DH $ 4095,3,0)

Here's the formula for COLUMN D: =VLOOKUP($A2,'SS File 2019Feb13'!$C$1:$DH$4095,4,0) 这是列D的公式:= VLOOKUP($ A2,'SS File 2019Feb13'!$ C $ 1:$ DH $ 4095,4,0)

Here's the formula for COLUMN E: =INDEX(AT:AV,MATCH(D2,AK:AK,1)+0,IF(B2="SB",1,IF(B2="CW",2,3))) 这是列E的公式: =INDEX(AT:AV,MATCH(D2,AK:AK,1)+0,IF(B2="SB",1,IF(B2="CW",2,3)))

解释障碍

数字表

Thanks for your help! 谢谢你的帮助!

It is difficult to exactly figure out what is going wrong, given that your example does not constitute a MWE (minimum working example), but I suspect that the mistake might have to do with the dataformat that the vlookup formula returns. 鉴于您的示例并不构成MWE (最小工作示例),因此很难准确地找出问题所在,但我怀疑该错误可能与vlookup公式返回的数据格式有关。 If the vlookup formula in column D returns a test/sting (ie "180"), rather than 180 formatted as a number, it might cause trouble in your index match formula as that requires numbers. 如果D列中的vlookup公式返回一个test/sting (即“ 180”),而不是格式为数字的180,则可能会导致索引匹配公式出现问题,因为这需要数字。

You could try: 您可以尝试:

    =INDEX(AT:AV,MATCH(VALUE(D2),AK:AK,1)+0,IF(B2="SB",1,IF(B2="CW",2,3)))

which will try to convert the returned value in D2 into a number (if that is possible). 它将尝试将D2中的返回值转换为数字(如果可能)。 Column B, IMHO, is less likely to be the problem, given that is already a string and gets compared to strings. B列,恕我直言,不太可能是问题所在,因为它已经是一个字符串并与字符串进行了比较。

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

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