Add Values of column from 2 different sheets into one sheet with corresponding date - excel

I trade on 2 accounts and make 2 different sheet for both with Date and Profit/Loss ( attached)
I don't trade on both account daily. i want to make a third sheet which can add the P/L of both sheet according to date.
Ex. you can see below , there are no entries for 8th and 13th sept on sheet2 , while sheet1 has.
I want sheet3 to show (2045+0) for 13th sept as per date.

try:
=QUERY({Sheet1!A2:B; Sheet2:A2:B};
"select Col1,sum(Col2) where Col2 is not null group by Col1 label sum(Col2)''"; 0)

Related

How to calculate Client Repeat Rate? (If any row in a column containing a name corresponds to a particular value then....)

I have a list of deals (usually unsorted) and I'm trying to find out if a company is a new client or a repeat client for each year (2019, 2020, & 2021).
The data is present as follows:
Company
Year
Company 1
2019
Company 2
2019
Company 2
2020
Company 2
2020
Company 3
2020
Company 3
2020
Company 2
2021
Company 4
2021
I need it to be calculated as:
Company
2019
2020
2021
Company 1
New
Lost
Lost
Company 2
New
Repeat
Repeat
Company 3
-
New
Lost
Company 4
-
-
New
I've created the desired outcome by creating a couple of helper columns, but how do I get the outcome without those? You can view the current work here: https://docs.google.com/spreadsheets/d/1jRTb1X4mFpLqyqADayqame-jWe2LoFizmARc7OCF424/edit#gid=1425919264
Struggling with using INDEX MATCH or VLOOKUP, specifically -> If [Company Name] is first signed in 2019, and any row in Column A containing [Company Name] corresponds to 2020, then [Company Name] is "Repeat" else....
Any help is appreciated.
In legacy Excel, this must be entered as an array formula
In Google sheets (assuming the same cell references) then the array aspect must also be made explicit, i.e.
=ARRAYFORMULA(IF(ISNA(MATCH($D2&E$1,$A$2:$A$9&$B$2:$B$9,0)),IF(OR(D2="New",D2="Lost"),"Lost","-"),IF(OR(D2="New",D2="Repeat"),"Repeat","New")))
Filter is Your Friend
On a separate sheet, in cell A1 as a heading lets place the word company and in B1 lets place status.
Now in cell A2 place =UNIQUE('Your Sheet Name'A2:A) to get a unique list of company names. Assuming your company names are on column A and start on the second row.
Before the next part, lets place the year somewhere in the sheet. Lets do in cell D1 and to the left in cell C1 lets type in "Year" for clarification.
Now in cell B2:B1000 put =IF(A2 = "", ,IF(INDEX(SORT(FILTER(Sheet1!$A$2:$B,Sheet1!$A$2:$A = A2),2,FALSE),1,2) >= $D$1,IF(COUNTIF(Sheet1!$A$2:$A,A2) > 1,"Recurring","New"),"Lost"))
We basically are saying If the cell to the left of this formula is not blank and the most recent entry is greater than or equal to the year I placed in D1 then I want to see if this is the first time we have this company in our dataset
If it is, then it would be new development, if not then it would be recurring. And if the most recent entry for this company is not greater than or equal to the year in D1 then it was lost.
grouped deals can be done like:
=INDEX(1*QUERY(A3:C, "select count(A) where A is not null group by A pivot C"))
and status like:
=ARRAYFORMULA(QUERY(IF(ISNUMBER(
QUERY(A3:C, "select count(A) where A is not null group by A pivot C"))*1=0, "lost", IF(ISNUMBER(
QUERY(A3:C, "select count(A) where A is not null group by A pivot C"))*1>ISNUMBER(
QUERY(A3:C, "select A,count(A) where A is not null group by A pivot C"))*1, "new", "repeat")), "offset 1", ))

SumIF three conditions meet return the forth column value

I am having two sheets Sheet1 & Sheet2, Sheet1 having four columns like EMP No, Project Number, Month & Working Days.
In the sheet2 I have same four column but some employee will be worked in two projects for that month, For example: If Emp No, project number & month matches, then 4th column value for that employee should be populated. And I am doing this by referring the cells in both the sheets.
Both sheets having the same order as mentioned in the below.
Column A = Emp No,
Column B = Project Number
Column C = Month
Column D = Working Days
=SUMIFS('Sheet2',$D$2:$D$10000,$C$2:$C$10000,"="&M2,$B$2:$B$10000,"="&C2,$A$2:$A$10000,A2)
I gather your aggregation happens in Sheet2 so the formula should be:
=SUMIFS(Sheet1!D:D,Sheet1!A:A,Sheet2!A1,Sheet1!B:B,Sheet2!B1,Sheet1!C:C,Sheet2!C1)
If your aggregations happens in Sheet1 just go with this one:
=SUMIFS(Sheet2!D:D,Sheet2!A:A,Sheet1!A1,Sheet2!B:B,Sheet1!B1,Sheet2!C:C,Sheet1!C1)
If I've understood correctly, Sheet2 can contain multiple lines for employees per project per month? So, for example, EMP No 1 could be listed for Project 1, in the month of January 5 times, with working days each time equalling 1, and Project 2, int he month of January 2 times, with working days each time equalling 1.
Your Sheet1 worksheet, intends to list all employees, projects and months uniquely in order to total the days worked on each project each month? Based on the example, EMP No 1 would have the following displayed:
What I would suggest, is providing you have the unique list in Sheet1 already set up, enter the following formula into cell D2 (Working Days) and then copy down. I have assumed 100 entries on Sheet2, so you will need to amend the Sheet2! ranges in the formula to suit your data.
=SUMIFS(Sheet2!$D$2:$D$101,Sheet2!$A$2:$A$101,Sheet1!$A2,Sheet2!$B$2:$B$101,Sheet1!$B2,Sheet2!$C$2:$C$101,Sheet1!$C2)

Need help referencing another excel sheet cell based on date

I am trying to build a workbook with 4 tabs for a small business.
There are 3 locations, and the first tab will be a scorecard of sorts.
So, on the first tab (named scorecard) I have something like
Date: August 30, 2017
loc sales
location 1 500
location 2 500
location 3 500
the other 3 tabs are names loc1,loc2,loc3 and each one is set up for 31 days going vertically like:
1 500
2 500
3 500
what I want is for on the scorecard sheet, to be able to select a cell on say loc1 sheet based on the date. I know how to reference other sheets, I just don't know how to reference a specific cell on the second sheet bases on the date entered in the first sheet.
So say today, August 30, it would pull =loc!1B30 for sales, =loc!C30 for customer count etc
I hope that makes sense, if not I can try and explain better
Is each cell for sales amount associated with a date? If so, you can use a "VLOOKUP" formula. Check out this page for a further explanation.
https://www.techonthenet.com/excel/formulas/vlookup.php
Using VLOOKUP, the "value" would be the cell of the date on the scorecard tab, the "table" would be the dates and sales values on the locX tab, the "index number" would be the column number in the table you select (probably 2 for you I assume if there is a date, then value), and the last portion of VLOOKUP would probably be set to false. That would be true if there were several of the same date for sales, but I doubt that from what I understand.
It would look like this:
=vlookup([date cell reference],[table to look up value in],[column number in table],false)

Excel: Index match if date matches month?

I have two excel sheets:
Data:
Column A Column E
01/01/2017 Supplier 1
05/01/2017 Supplier 2
05/01/2017 Supplier 1
Sheet 2:
I am trying to look up the supplier where the month of the date in column A matches the month number in cell F11.
F11 = 1
=IF(ISERROR(INDEX(Data!$A:$I,SMALL(IF(MONTH(Data!A:A)=$F$11,ROW(Data!$A:$A)),ROW(1:1)),5)),"",INDEX(Data!$A:$I,SMALL(IF(MONTH(Data!A:A)=$F$11,ROW(Data!$A:$A)),ROW(1:1)),5))
For some reason this doesn't work and i get no result.
I also need to only list each supplier name the once, unique values. But i believe my formula gives me the same result twice.
Please can someone show me where i am going wrong?
Can't you do this with a pivot table?
Just drag the date field into the columns box, then right-click, choose 'Group' and choose 'months'. Then drag the supplier field underneath it and you should get a list of all unique suppliers by month.
Edit:
Example below.

How to Filter out Duplicate rows(By a specific column) in Excel or Open Office CALC ??

I want to filter out rows in Excel/Open Office CALC like this :
Here is My Table Structure
Emp_No and Note Added are the column names
Emp_no. Note added
10 salary due by 13th Oct
10 salary pending
10 salary paid
10 salary not paid
23 salary paid
23 salary not paid for 2 months
23 salary due this month
Now, I want to keep only the first ROW from the set of rows containing Emp_No as 10 and keep only first ROW from the next set of values containing Emp_No value as 23.
So in short, I want a output like this :
Emp_no. Note added
10 salary due by 13th Oct
23 salary paid
Kindly help !!
With a helper column this formula:
=IF(B1=B2,"",B2)
in Row2 and copied down should pick out the first instance (each change) in Emp_no., if that is in ColumnB.
Filtering to select (Blanks) in the column with these formulae should then pick out all the rows where the Emp_no. is the same as the row immediately above - at which point they may be deleted to achieve the result shown as required from the data sample provided.

Resources