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

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", ))

Related

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

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)

Need to revise this formula that displays data based on another cell's contents

I can't get this formula working properly. Here is what I need to do (see included image below):
I need the data in rows 9-10 (sales) to be displayed/copied in rows 28-29 (collections) based on the number in cells C9 and C10 (payment terms). For example, if there are $1,900 in GM sales on Tuesday, Jan 5 (cell F9) and payment terms are 10 days (cell C9), then I need $1,900 displayed on Tuesday, Jan 19 (cell P28), in the collections section (rows 28-29), 10 business days from when the sales were made. Does this make sense? Here is the formula I am using now (starting in cell E28 and being dragged to the right):
=IF(COLUMN() - E9 < 1, 0, INDIRECT(ADDRESS(9, COLUMN() - $C$9)))
However, it is not working completely. It is moving the data labels to the left of the data table that are not supposed to be included in the data table. Only sales data starting in cell E9 are supposed to be moved. You can see this issue in row 28 (columns J-N) in the image below.
This formula also has to work with payment terms from 1 day - 10 days. So, the $5,000 in Ford sales on Monday, Jan 4 (cell F10), with payment terms of 3 days (cell C10), needs to be displayed on Friday, Jan 8 (cell I29).
Let me know if you need any additional details to solve this issue. Thanks!
Is this what you're looking for?
=IFERROR(INDEX($E$9:$X$13,MATCH($B28,$B$9:$B$13,0),MATCH(WORKDAY(E$5,-INDEX($C$9:$C$13,MATCH($B28,$B$9:$B$13,0))),$E$5:$X$5,0)),0)
The formula indexes the sales amounts and shows the amount in the row where the customer name mentioned at sales equals the customer at the result section with the column where the result date equals the date mentioned at sales minus the number of workdays mentioned behind the customer name at the sales section.

Excel function to Auto-Populate value in Column C based on the combination of values in column A and Column B

I have 3 columns with values filled in already in my metasheet. A combination of values in column A and column B makes the selection unique. I need to pull/return the value in column C for the values selected in columns A & B. for example: In sheet 1, I have the following data:
country Month weather
1 USA Jan winter
2 USA Feb fall
3 USA May summer
4 China Jan summer
5 China Feb spring
6 China May fall
7 India Jan fall
8 India Feb summer
9 India May Rain
Now, say for a random row 25, I have A25 as a dropdown list with value selected ="India" and B25 as a dropdown list with value selected="Feb", in which case I would want C25 to have a dropdown list with the value in it being "Summer".
I tried this formula:
=VLOOKUP(B25, OFFSET(B$1:C$9, MATCH(A25,A$1:A$9,0)-1, 0, 2, 2), 2, 0)
But this one gives me an error: "The list source must be a delimited list, or a reference to a single row or column".
I did refer to this solution. But I get the above mentioned error as the data validation for C25 is a list.
Any suggestions/ideas on this would be helpful!
Thank you!
If your sheet is set-up like this:
You can use:
=INDEX(C2:C10,INDEX(MATCH(1,(A2:A10=E2)*(B2:B10=F2),0),0))
You will need to make a second sheet with a matrix like following -
Here you will define all the weathers for country and month pair. I have used the default name i.e. Sheet2 and filled the values that were available from your data. You will lookup the values from this for filling on Sheet1. Sheet1 will be like this -
=VLOOKUP(B2,Sheet2!$A$1:$D$13, MATCH(A2, Sheet2!$A$1:$D$1, 0), FALSE)
Here B2 is the month value, A2 is the country value. Sheet2!$A$1:$D$13 is the range for VLOOKUP and Sheet2!$A$1:$D$1 is the range for MATCH. VLOOKUP will match the month, MATCH will match the country and get the column index.

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)

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