在Vlookup或IndexMatch中使用增量列拉取数据从excel数据表中无零 [英] Pulling data from big excel datatable with incremental column in Vlookup or IndexMatch without zeros

查看:190
本文介绍了在Vlookup或IndexMatch中使用增量列拉取数据从excel数据表中无零的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试一段时间来为最近一次导入的日期和上一个日期提取大约160个指标的数据,所以我可以自动化一些东西。



这是我的数据表的样子:





我从MAX表中获取最新的日期,上一个日期从最后一个日期结束了7天。



我想将这两个日期的指标一直到datatable的末尾,而不显示任何零(只是留空,条目为空)



问题是:1 - 数据格式化为datatable,因为很多图自动进给。由于它的datatable它没有从vlookup的正常单元格引用正确的值。 2 - 由于它的datatable它难以为vlookup列增加+1增量,因此我不必手动输入165个公式。 3 - 我真的很喜欢一个公式,当条目为空白但不返回空白时不给零。



我试过:

  = VLOOKUP($ C $ 3,$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ 2,Table1 [BOADPMOUS106]))

和其中的很多变体。没有一个工作很好,或者能够被拉到桌子的末端。当然,他们返回0与空白条目。有人有想法来解决这个问题吗?



解决方案

如果您返回基于文本的结果,可以将一个零长度字符串附加到 VLOOKUP功能

  = VLOOKUP($ C $ 3,Table1 [#All],2,FALSE)&
pre>

这不会改变返回的字符串,但返回值为空时不会显示为零。



如果您返回数字或日期,则必须检查返回值是否为空。

  = IF(LEN VLOOKUP($ C $ 3,Table1 [#All],2,FALSE)),VLOOKUP($ C $ 3,Table1 [#All],2,FALSE),)
/ pre>

不幸的是,这是一个双重查询,我们必须在 IFERROR功能来了,但到目前为止,没有本地工作表IFBLANK功能。



UDF IFBLANK可以轻松写入。


I am trying for a while to pull data for around 160 metrics for the last imported date and previous one so I can automate some stuff.

This is how my datatable looks like:

I get the latest date from the table with a MAX function and the previous one with substantiating 7 days from the last one.

I would like to get the metrics for these two dates all the way to the end of the datatable without showing any zeroes (just leave blank where the entry is blank)

Problems are: 1-the data is formatted as datatable because a lot of graphs are feeding from it automatically. Since its a datatable it doesnt pull the right value from normal cell references of vlookup. 2-since its a datatable its hard to enforce +1 increment in columns for vlookup so that I dont have to manually type in 165 formulas. 3-I would really like a formula not to give zero when the entry is blank but also return blank.

I tried:

    =VLOOKUP($C$3,$C$13:$FH$200,D:D, FALSE)
    =VLOOKUP($C$3,Table1[#All],2, FALSE)
    =INDEX(Table1[Date],MATCH($C$2,Table1[BOADPMOUS106]))

and a lot of variations of those. None of them works well or was able to be pulled to the end of the table. And of course they return 0 with blank entries.

Is anyone having an idea to solve this?

解决方案

If you are returning a text based result, you can append a zero-length string to the VLOOKUP function.

=VLOOKUP($C$3,Table1[#All],2, FALSE)&""

This will not alter the string returned but will not show a zero when the return value would be blank.

If you are returning numbers or dates then you have to check if the return value is blank.

=IF(LEN(VLOOKUP($C$3,Table1[#All],2, FALSE)), VLOOKUP($C$3,Table1[#All],2, FALSE), "")

Unfortunately, this is a double lookup much as we had to do to check for errors before the IFERROR function came along but so far, there is no native worksheet IFBLANK function.

A UDF IFBLANK could be easily written.

这篇关于在Vlookup或IndexMatch中使用增量列拉取数据从excel数据表中无零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆