Google Sheets: Join two tables together

坚强是说给别人听的谎言 提交于 2020-07-31 05:44:44

问题


Link to sample sheet - https://docs.google.com/spreadsheets/d/1nKQXHwVO8KjsOy5qvjzh-s-YYRUYlAoH-3aXYbwcKsA/edit?usp=sharing

I have a report that's downloaded from the google ads console which looks like this:

I get a report from the client which attributes leads to google ads campaigns like this:

I want to combine both these tables together to make them look like this:

If you look at the data in the first to tables, you'll see that the report the client shares with me has leads attributed to 24th March. This date is not present in the report that I got out of the google ads console. Using a sumifs formula will not capture all the leads that I get from the client's report.

Essentially, to get the data from both tables in the output table, I need to do a full outer join.

I'm not sure how to do that in google sheets. Any help you can give me would be greatly appreciated!


回答1:


I made a new tab in your sample called MK.Help.

I then put this formula in cell L3:

=ARRAYFORMULA(QUERY({A3:G;{H4:I,IFERROR(ROW(H4:H)/{0,0,0,0}),J4:J}},"select Col1,Col2,SUM(Col3),SUM(Col4),SUM(Col5),SUM(Col6),SUM(Col7) where Col1 is not null group by Col1,Col2 label SUM(Col3)'Impressions',SUM(Col4)'Clicks',SUM(Col5)'Cost',SUM(Col6)'Leads',SUM(Col7)'Offline Leads'"))

That do what you're hoping?



来源:https://stackoverflow.com/questions/61890286/google-sheets-join-two-tables-together

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