简体   繁体   English

在Excel中交叉引用数据

[英]Cross Referencing Data in Excel

I am trying to start an advertisement analytics tool for my business. 我正在尝试为我的业务启动广告分析工具。 I have an Excel spreadsheet with 3 Sheets. 我有3张Excel电子表格。 Sheet 1 contains data about the advert clickers, Sheet 2 contains information about the product buyers and Sheet 3 should collect data based on cross-referencing data between Sheets 1 & 2. 工作表1包含有关广告点击者的数据,工作表2包含有关产品购买者的信息,工作表3应基于工作表1和2之间的交叉引用数据收集数据。

The columns in Sheet 1 are as follows: 表格1中的列如下:

    A           B       C               D              E                F       G
------------------------------------------------------------------------------------
product type, tag, click date/time, IP address, expiry time (days), expiry date/time 

Each row represents a click. 每行代表一次点击。 The expiry time (days) is determined by the product type, and the expiry time/date is the expiry time (days) added to the click date/time. 有效期限(天)由产品类型确定,有效期限/日期是添加到点击日期/时间的有效期限(天)。 The tag is a code that tells me where the link was found by the clicker. 标签是一个代码,它告诉我单击器在哪里找到了链接。

The columns in Sheet 2 are as follows: 表格2中的列如下:

       A           B               C
---------------------------------------------
product type, IP address, purchase date/time. 

Each row represents a product sale. 每行代表一个产品销售。

There are more rows in Sheet 2 than there are in Sheet 1. 工作表2中的行多于工作表1中的行。

There are three pieces of information that I want to match between Sheet 1 and Sheet 2: IP address, product type and whether the purchase date/time (Sheet 2) falls between the click date/time and the expiry date/time . 在工作表1和工作表2之间,我需要匹配三项信息: IP address, product type以及purchase date/time (表2)是否介于点击date/time和到期date/time I have made formulas that can verify whether this occurs but only for assigned cells in each Sheet. 我制作了可以验证是否发生这种情况的公式,但仅适用于每个工作表中分配的单元格。

I am trying to get Excel to match one row from Sheet 1 to all rows in Sheet 2. As there are more rows in Sheet 2 than in Sheet 1, there could be multiple matches for each tag as defined in Sheet 1, as customers may decide to buy more than one product after clicking the link. 我正在尝试使Excel将工作表1中的一行与工作表2中的所有行进行匹配。由于工作表2中的行比工作表1中的行多,因此客户可能会对工作表1中定义的每个标签进行多次匹配点击链接后决定购买多个产品。

Is there a way to try and match the data between the two Sheets and then collect the number of matches in Sheet 3? 有没有办法尝试匹配两个工作表之间的数据,然后收集工作表3中的匹配项数量? It may be easier to achieve if the IP address and product type are matched first and then to try and see if the purchase date/time falls within the click date/time and the expiry date/time . 如果先匹配IP地址和产品类型,然后尝试查看purchase date/time在点击date/time和到期date/time之内,则可能更容易实现。

Any help on this would be greatly appreciated and thanks so much in advance. 在此方面的任何帮助将不胜感激,并在此先感谢。 This has been bugging me for a while and I can't figure it out. 这已经困扰了我一段时间,我无法弄清楚。

I think I have a good start for you. 我想我有一个好的开始。 With vlookup you can specify multiple criteria. 使用vlookup,您可以指定多个条件。 First start by bringing in the useful data into one sheet - I would take column D and E of "sheet2" and use these: 首先,将有用的数据放入一张表中-我将使用“ sheet2”的D和E列,并使用它们:

In D: 在D中:

=VLOOKUP(A2& " "&B2,Sheet1!$A$2:[BOTTOM RIGHT OF TABLE],3)

The 3 at the end specifies you want to return the click date. 末尾的3表示您要返回点击日期。

In E: 在E中:

=VLOOKUP(A2& " "&B2,Sheet1!$A$2:[BOTTOM RIGHT OF TABLE],6)

The 4 at the end specifies you want to retune the expiry date. 最后的4表示您要重新调整到期日期。

Once they are on one sheet, you can do an if statement comparison to see if the date (Column C) falls between your two dates (Column D and E). 将它们放在一张纸上后,您可以进行if语句比较,以查看日期(C列)是否介于两个日期(D列和E列)之间。 Here is the if statement for that: 这是if语句:

=IF(AND(C2>=D2,C2<=E2),1,0)

There is one shortfall to this, and that is if there are multiple matches for both product AND ip - this will only return 1, but otherwise you're talking about scripting something in VBA. 这有一个不足之处,那就是如果产品AND ip都存在多个匹配项-这只会返回1,但是否则,您谈论的是在VBA中编写脚本。

In excel you can refer cell based on sheet like this and make it on third sheet: 在excel中,您可以像这样基于工作表引用单元格并将其放在第三工作表中:

=Sheet1!A1+Sheet2!A2 = Sheet1!A1 + Sheet2!A2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM