Pair Column A & B, get the matching results in C and the difference in D

三世轮回 提交于 2020-01-25 05:44:26

问题


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! =)


回答1:


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:

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

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

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.



来源:https://stackoverflow.com/questions/26812772/pair-column-a-b-get-the-matching-results-in-c-and-the-difference-in-d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!