Excel formula looks up by date and other characteristics - excel

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

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.

Using Gathering/Automating information from Excel sheets

I have multiple Excel files with sheets that show bank account information in the picture. I want to show a daily beginning and ending balance for each account and also show a total of the transactions that took place on each account with a daily closing balance. What is a good way to go about doing this? The end result with be a sheet or a table with each daily closing amount and each total of the transactions that took place in the various daily accounts
put a table like this in G9 onwards, showing all the bank accounts listed in column A:
then put this formula in H9
=SUMIF(OFFSET($B$6,MATCH($G9,$A$6:$A$200,0),0,MATCH($G10,$A$6:$A$200,0)-MATCH($G9,$A$6:$A$200,0)),$B$7,OFFSET(C$6,MATCH($G9,$A$6:$A$200,0),0,MATCH($G10,$A$6:$A$299,0)-MATCH($G9,$A$6:$A$200,0)))
copy the formula down next to the bank account numbers and to the right 3 more columns (4) in total
this should work as long as your data isn't long than 200 rows. if it is change all the 200's in the code to a number larger than your last row.
it may struggle for the last bank account, if it does add end in a cell just below you data in column A and end as a final entry in that table built from G9 onwards, also make sure that the 200's cover the row end is in or update them to do so.
Finally let us know how it goes and mark the answer accepted if it does what you need :)

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. 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

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.

Invoice List Running Balance based on date and Account

I'm using Excel 2010 and have made a UserForm that Displays a complete list of Invoices from Worksheets("InvoiceListIncome") using a ListBox control, the Worksheet has 13 Columns and Thousands of rows, an example image below;
The problem I'm having is the Balance Row Range("InvoiceListIncome_Balance")" displays the balance of each Invoice individual, what I need is a running balance starting from the first invoice Range("InvoiceListIncome_Date") so with each Transaction it Adds up the Current + all previous invoices for that account.
The Macro I'm currently using is;
Range("InvoiceListIncome_Balance").FormulaR1C1 = "=SUM(RC[-1])-SUM(RC[-2])"
which simply subtracts whats Paid in Column F from Item Price in Column G, but I cant seem to figure out how to add all previous balances by date, I can either get it to Sum the complete Range with the Customers account as the criteria or just the activerow.
I have been running circles trying to figure this out for days now, any help would be muchly appreciated, thanks.
Here is an example of what I need;
Assuming you have Account, Price, and Paid in columns A, D, and E, respectively, with your first row of data in row 2, try the following formula in row 2:
=SUMIF($A$2:$A2,$A2,$E$2:$E2)-SUMIF($A$2:$A2,$A2,$D$2:$D2)
Copy the formula down the column. This assumes that your data is sorted in increasing chronological order as you show.
Also, if this formula is working, you have the wrong sign on the 4th row from the bottom of the column that you want????
You want a running total, so you want to incorporate the balance of row (n-1) when calculating the balance for row n.
Based on your 1st picture, make the following changes:
formula in G2: =F2-E2
formula in G3: =G2+F3-E3
copy formula from G3 down to the end of the list; the last value is your current balance
edit
sorry ... I seem to have overlooked the break-on-account condition. Well that makes it even easier as there is only one formula you need all the way down ....
to break on customer (provided the customer column is sorted) you would use the following formula
formula in G2: =IF(A2=A1,G1+F2-E2,F2-E2)
copy formula from G2 down to the end of the list
(if this.account = previous.account then calculate.running.total else create.new.balance)
This will work as long as your first customers' name is <> "Account" :-)

Resources