根据公共/键列映射两个列
如下所示,
此纸提供了类型和产品
类型 | 产品 |
---|---|
XMAS_GREEN | XMAS TREE |
XMAS_RED | XMAS |
XMAS_RED | TREEX |
XMAS_MAS_BLUE | bunny bunny |
bunny_blue | bunny |
un
TREE | BUNNY_RED BUNNY |
---|---|
XMAS TREE XMAS | 我有两张纸, Ltd |
Bunny | Bunny Corp Ltd |
使用上面的床单,我想生成另一张床单,显示给供应商映射的类型(基于产品)
类型 | 供应商 |
---|---|
XMAS_GREEN | XMAS CORP |
XMAS_RED XMAS_RED | XMAS_MAS_MAS_BLUE |
BUNNY_RED | XMAS CORP LTD |
BUNNY_RED | CORP LTD |
BUNNY_BLUE | BUNNY CORP LTD |
到目前为止,我一直在尝试使用VSookup来匹配列表,但期望它可以使用1:1映射来工作。我正在尝试的另一种方法是对product
进行计数重复,并基于product
count 供应商
。可以使用这需要扩大6000多种记录,并且可以使用VBA宏。这是在2016年。我不是高级Excel用户,并且对正确方向的任何帮助都非常感谢。
I have two sheets as shown below
This sheet provides a mapping between type and product
Type | Product |
---|---|
Xmas_Green | Xmas Tree |
Xmas_Red | Xmas Tree |
Xmas_Blue | Xmas Tree |
Bunny_Red | Bunny |
Bunny_Blue | Bunny |
and the another sheet provides mapping between products and vendor as shown below
Product | Vendor |
---|---|
Xmas Tree | Xmas Corp Ltd |
Bunny | Bunny Corp Ltd |
Using the above sheets, I want to generate another sheet showing type to vendor mapping (based on product)
Type | Vendor |
---|---|
Xmas_Green | Xmas Corp Ltd |
Xmas_Red | Xmas Corp Ltd |
Xmas_Blue | Xmas Corp Ltd |
Bunny_Red | Bunny Corp Ltd |
Bunny_Blue | Bunny Corp Ltd |
So far I have tried to use VSLOOKUP to match tables based on column but it expects 1:1 mapping to work. Another approach I'm trying is to count duplicates on Product
and duplicate the Vendor
based on Product
count. This needs to scale up for 6000+ records and VBA macros can be used. This is on 2016. I'm not an advanced Excel user and any help in the right direction is much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有几种方法可以做到这一点。
Xlookup()
可能最合适。如果您在 excel-2016 上,则可以使用
index/match
like-with
vlookup()
可以尝试 -最新版本的 Microsoft-365 可以使用
byrow()
一个GO。和
filter()
函数。There are few ways to do that.
XLOOKUP()
may best fit.If you are on Excel-2016 then can use
INDEX/MATCH
like-With
VLOOKUP()
can try-With most recent release of Microsoft-365 can use
BYROW()
for one go.And by
FILTER()
function.另一种方法是使用电源查询。也许这就是您想要的6000行,这就是您想要的。
您可以将两个输入表作为Excel表设置,我们称它们为 Tabletype 和 TableProduct 。
然后您可以进入电源查询编辑器,并使用下面的脚本合并两个表。
然后将此脚本粘贴到写入高级编辑器的空脚本上。
然后关闭并加载到并选择要桌子去的地方。要更新它,
右键单击
和刷新
。Another approach would be to use Power Query. Perhaps this is what you want if you are working with 6000 rows.
You could set up your two input tables as Excel Tables, let's call them tableType and tableProduct.
You can then go into the Power Query editor and use the script below to merge the two tables.
Then paste this script over the empty script that is written into the Advanced Editor.
Then Close and Load To and choose where you want your table to go. To update it,
Right-Click
andRefresh
.