配对列A和B,得到C的匹配结果和D的差异 [英] Pair Column A & B, get the matching results in C and the difference in D

查看:97
本文介绍了配对列A和B,得到C的匹配结果和D的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有从SQL Server 2008 DB获得的清单A"和清单B"(及其对应的卷)列. A有一个近端. 1000行和B(以及C卷)大约为800,因此几乎不可能手动比较它们.
列"Manifesto C"必须具有A> B匹配和配对的结果,并在没有匹配项的地方添加空白单元格,例如 此图像示例显示了 .

I have columns "Manifesto A" and "Manifesto B" (with its correspondent volumes) that I get from my SQL Server 2008 DB. A has aprox. 1000 lines and B (and Volumes C) around 800, so it's almost impossible to compare they by hand.
Column "Manifesto C" must have the results of the A>B matching and pairing, and add blank cells where there is no match, as this image example shows.

我已经尝试过

I've tried this, this, and some SQL CASE WHEN. I don't know VBA, but I'll copy paste anything if you say so.

有人可以帮我解决这个问题吗?
提前谢谢! =)

Can anyone help me sort this out?
Thx in advance! =)

推荐答案

如果我正确理解它,那么您已经有了数据,只需要在 Excel 中将其配对?
如果是这样,假设您的数据如下:

If I understand it correctly, you already have the data, you only need to pair it in Excel?
If so, suppose you have your data like below:

在G3中使用以下公式:
=IF(NOT(ISERROR(MATCH(B3,D$3:D$17,0))),B3,"")

Use this formula in G3:
=IF(NOT(ISERROR(MATCH(B3,D$3:D$17,0))),B3,"")

H3中的这个公式:
=IFERROR(VLOOKUP(G3,D$2:E$17,2,0),"")

And this formula in H3:
=IFERROR(VLOOKUP(G3,D$2:E$17,2,0),"")

将其复制到其余单元格中.
由于某些原因,我不知道为什么您的图像没有显示 Manifesto A B 中出现的3249032563的结果. HTH.

Copy it to the rest of the cells.
For some reason, I don't know why your image didn't show up the result for 32490 and 32563 which are both present in Manifesto A and B. HTH.

这篇关于配对列A和B,得到C的匹配结果和D的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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