在Google工作表中加入表格-完全加入 [英] Join tables in google sheet - full join

查看:64
本文介绍了在Google工作表中加入表格-完全加入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Google电子表格中有两个表.它们具有共同的唯一标识符(帐户ID).现在,我需要将这些表连接到包含两个表中所有行的第三个表中.

请看一下这张纸:

或点击链接到示例电子表格:

I have two tables in google spreadsheet. They have a common unique identifier (Account id). Now I need to join these tables into a third table containing all rows from both tables.

Please have a look at this sheet:

or follow the link to an example spreadsheet: https://docs.google.com/spreadsheets/d/17ka2tS5ysXqJnrpCxCTwNmCsTORPFP1Gatq4p1fPldA/edit?usp=sharing

I have manage to join the tables using this arrayformula:

=ARRAYFORMULA({G3:H8,VLOOKUP(G3:G8,{A3:A7,B3:C7},{2,3},false)})

But with this formula the joined table "misses" two rows:

20  N/A Klaus   Berlin
4   VW  David   Paris

The first missing row is found only in Table 1. The second missing has an ID that is found in Table 2 and has two (2) matching ID's in Table2, but only one row in the joined table

Is there a way to provide a formula that can handle this?

解决方案

previous answer is incorrect. use:

=ARRAYFORMULA(QUERY(UNIQUE(IFNA({G2:H10, 
 VLOOKUP(G2:G10, A2:C10, {2, 3}, 0);
 VLOOKUP({A3:A10; G3:G10}, {G3:H10; {A3:A10, IF(A3:A10, )}}, {1, 2}, 0), {B3:C10; 
 VLOOKUP(G3:G10, {A3:C10; {G3:G10, IF(G3:G10, ), IF(G3:G10, )}}, {2, 3}, 0)}})), 
 "where Col1 is not null order by Col1", 1))

这篇关于在Google工作表中加入表格-完全加入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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