Cross Referencing Data in Excel - excel

I am trying to start an advertisement analytics tool for my business. I have an Excel spreadsheet with 3 Sheets. 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.
The columns in Sheet 1 are as follows:
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:
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.
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. 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.
Is there a way to try and match the data between the two Sheets and then collect the number of matches in Sheet 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.
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. First start by bringing in the useful data into one sheet - I would take column D and E of "sheet2" and use these:
In 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.
In 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.
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).
Here is the if statement for that:
=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.

In excel you can refer cell based on sheet like this and make it on third sheet:
=Sheet1!A1+Sheet2!A2

Related

Replace value in the same column based on ID number EXCEL

Does anyone have an idea how to solve this problem using Excel? I have this table. As you can see there is false information in the data, as the "Customer_since" column has different values for the same customer (column "cust_id"). "Customer since" column defines the year of the customer's first purchase. Here is the table:
In fact, the year of the first purchase must be the same in all rows for the same client. In my solution, I would like to keep the earliest year (of the first purchase) for all clients. As you can see one client can appear in many rows, for example, client 275250 had 8 purchases (means 8 rows in a data set) and client 275246 had only 4 purchases. I cannot change it manually as the data set contains over 7000 rows. The desired solution would be to get the same year of their first purchase for the same customer in all rows (for example, correct data is for 275252 and 275233 customers).
MINIFS will get you there. https://support.microsoft.com/en-us/office/minifs-function-6ca1ddaa-079b-4e74-80cc-72eef32e6599
Below, I'm using formula =MINIFS(C:C,B:B,B2) where C:C would be the range of your transaction dates, B:B is the range of customer IDs, and B2 is the current customer ID.
I would do the following:
Create a new table with unique cust_id and the corresponding min(Customer_since). A PivotTable would do it easily.
Change the column Customer_since to use XLOOKUP() to find the correct value on the new table.
If needed, you can do it on another worksheet and Paste Values back into this.

Excel formula looks up by date and other characteristics

Hello I have a file that has two tabs. In the first tab it lists all bank accounts down the bottom of the page in rows. The list includes details about each account from columns A-H and then it has dates going all the way out from I-EY. The details in A-H have the unique identifier I created in column A and the other details in B-H most relevant for this is the account type(ZBA or Balance) in column G. For the data in I-EY, I have the dates listed across the top in row 2 for all dates going out for each bank account. For each date I populated the balance its a balance account or the activity if it's a ZBA. This is the data that I will use for the other subsequent tab #2. The data in tab 1 is all hardcoded.
In Tab#2, its setup the exact same way. All the bank accounts are in the same rows as tab 1 but the columns are off by one. The dates start one day earlier in tab 1.(tab1 in column I starts with 6/30 and in tab 2 column I starts as 7/1) I will get into why. In tab 2 I want to calculate or pull the daily activity for each account based on the type of account it is. If says balance in column G) i want to calculate for each date the change in balances from the prior day. (So for 7/1 if its a balance account take the balance in 7/1 columnJ and substract the balance in column I). This will populate the activity for 7/1 in tab 2. If its a ZBA then just take that specific number.
So I was hoping to perform this function I can have a standard if formula but I wanted to avoid any problems on a daily basis by creating a formula in tab 2 that looks up that date(row 2) and what type of account it is. If it's a balance account i want it to take the date in row 2 for each column and have it lookup the balance for the previous day(Date - 1) so it calculates and then if its a ZBA just look up the date and find the balance for that day.
Hope this makes sense. Appreciate all the help
So basically i need a formula that

Adding values to different cells depending on conditions - Excel

I am not very good with excel formulas, and I would need some help with a process I want to implement:
Simplifying things, I have an excel sheet (sheet n°1) with rows like this:
Company name | Price | Date
On other excel sheet (sheet n°2) I have one row for every company, and in each column there are all 12 months. I would need a formula so every time I add a row in the first sheet, the price I add is automatically added to the corresponding company row and in the corresponding month (based on the date) on sheet 2
I am really lost here, I know how to apply simple formulas, but not this, is there a way to add each value to a different cell depending on some conditions?
I forgot to add, that I would need to sum this values in sheet 2, so every time I add a new value, it is summed to the actual value of the corresponding cell.
I hope my english is not to bad, and thank you in advance!! :)
Use SUMIFS()
=SUMIFS($Q:$Q,$P:$P,$A2,$R:$R,">="&EOMONTH(B$1,-1)+1,$R:$R,"<"&EOMONTH(B$1,0)+1)
One caveat to this the month headers must be an actual date in the month desired. This can be formatted any way you want to display. My cells all contain the 1st of each month as their true dates.

Excel Formula, script or Macro that takes data from one SHEET 1, search, compare and inputs data to another SHEET 2

I am trying to create a tracker that will allow me collect attendance data for my employees in Sheet 1. I then want to display that data to track, compare and create some sort of pattern/trending report.
Compare an username from SHEET 1/row x with email ID on SHEET 2/row Y
If STEP 1 finds a match then compare, format and copy the data to the correct cell based on the Date.
Sheet 1
Username Instance Date
joe#xyz.com sick 10/1/2020
Sheet 2
Present Absent
10/1 10/2 10/3 10/4 Total Total
NAME Thu Fri Sat Sun
Joe 1 0 1 2 1 4
I have tried VLOOKUP and MATCH but I am not very familiar with the usage; therefore I am getting lost on choosing the correct cells/columns to compare from one sheet to the other.
Any help will be greatly appreciated...
Id possibly look at how you want to analyse your data. As it seems to be you want to take the data and inject it straight into an absence report of some kind.
Try looking at it this way
1) take your input
2) Validate it (with a vlookup or match)
3) if found write the data to a new line in a data sheet. username, instance, date
This will build a database of sorts that you can then report on.
4) Pivot the data with username for rows, date for columns. Format the date as you wish depending on granularity.
You can use the sheets change event to pick up the data, validate it and copy it to a db sheet.

excel - advanced vlookup or other formula?

I have a question regarding excel and I am looking for a formula that can help me transport my data from one sheet to the other. I have some experience with excel, however I am not a pro at it, so I apologize if this is a very trivial question but would also be happy since that would mean it probably has a very trivial answer! Unfortunately I do not have enough reputation points yet to post images, but I will try to explain it as clearly as possible.
Basically I am creating an excel template and the goal is to have 2 sheets in excel.
In the first sheet I have a column with following input in rows A1 - A3: Sales Region,
Country, Account ID's.
Above is the example of column A; from column B --> x; I will put e.g.
Americas, US and as many account numbers as there are in that specific country.
However on the second sheet it gets a bit complicated. My goal is that all the account numbers from sheet 1 irrespective of their sales region and country (which also means irrespective of their column) will automatically be listed on the second sheet.
The second sheet will be organized in the following way:
From column A - C; sales region, country and account ID.; from column D - x financial information for each account.
As a first step I want all the different account ID's from the different columns on the first sheet to be listed under column C (account ID's) on the seconds sheet.
As a second step I want column A - B to be automatically filled out according to account number by accessing the information in which column and thus sales region and country the account is in on sheet one.
I don't think a simple vlookup would do the job, especially for step 1, since I want the account ID's from many different columns and rows in sheet 1 to be listed in just one column....
hope it is clear enough! Would appreciate any help! :) thanks in advance!
The first step take all of column A and copy it to the 2nd sheet on column C.
Select data ribbon and select remove duplicates.
For column A insert vlookup for column C for all the data in 1st sheet
For column B insert vlookup for column B for all the data in 1st sheet
Those value will work well only if an ID has one valid Region and country.
Now just use custom sort to sort it in the way you desire.

Resources