How To Figure Out Repeat Purchase Rate With Multiple Variables - excel

I have data in an excel sheet that is essentially a list of all orders for my company over its life span (approximately 14 thousand orders if it matters.) The following fields are relevant for what I'm trying to do currently.
Purchase date (i.e. 6/23/19)
Customer ID (unique ID given to each customer, this ID is constant across all of a customers purchases)
Product category (widgets, woozits, etc.)
Sales person (John Doe, Jane Doe, etc.)
What I'm trying to figure out is our repeat purchase rate by category, and then by sales person.
So ideally I'd like to be able to determine something like
Product category: Widgets
20% of people whose first purchase from us is a widget, purchased something else later on
Of widgets sold by John Doe to first time customers, 15% of the customers purchased something else from us later on
Of widgets sold by Jane Doe to first time customers, 25% of customers purchased something else from us later on.
So basically trying to figure out if different sales reps have better repeat purchase rates on their orders, however we must divide this by product category as our repeat purchase rate by category is going to vary widely (and some sales reps only sell items from certain categories so it would be unfair to compare across categories.)
I believe to do this I need to figure out how to say something like
"Find every widget John Doe sold ; see how many have customer ID's that did not appear on an earlier date ; then see what % of those customer ID's appear at a later date regardless of the next product category or sales person they purchased from."
Hopefully someone can help. I apologize if I didn't explain something particularly well, if there's any confusion I can try my best to clarify.
Thank you!

Related

Stripe: Can I create a single "1 month free" promo code for multiple products?

I've been reading though the Stripe documentation but can't figure out if it's possible to have a single promotion code for multiple products, to give a 1-month discount, for products which have both monthly and yearly pricing.
Our product setup is like this:
Basic tier product
Monthly price (upsells to yearly price)
Yearly price
Plus tier product
Monthly price (upsells to yearly price)
Yearly price
I’d like to set up a single promotion code to give to customers, to discount the price of one month, regardless of the product they choose and whether they select monthly or yearly billing.
If I set up a 100% discount coupon then I can apply it to both products, but then if the user chooses annual billing, it discounts the price of the entire year (we only want to discount the price of one month).
If we set up fixed-amount discount coupons, then I'd need to create different promotion codes for each product (we only want to give customers a single code).
Maybe this simply isn't possible with Stripe, but it seems like quite a reasonable/common use case, so wanted check.
Any help much appreciated!
Unfortunately this is not possible with a single Stripe coupon. You would need to create at least two different coupons: one for the basic tier product worth one month, and one for the plus tier worth one month.

Choose correct PRODUCT COST from ROW based on amount sold

I am making a sheet to CALCULATE REAL REVENUE from each sale I make on my online store.
The problem is that the COST of my products is not always constant. It varies depending on many factors so each time I make a purchase I add the NEW PRODUCTS COST (LATEST COST).
Each time I make a new purchase I will add the QUANTITY and the new COST. (PURCHASE 1, PURCHASE 2, PURCHASE 3,etc).
Screenshoot of my sheet with example on ROW 41
In Column B I want to know which is the CURRENT COST based on the amount of TOTAL SALES of each product.
For example:
If I have sold less than 100 ( Pruchase 1 QUANTITY) then I need the formula to choose value of E41 (PURCHASE 1 COST).
If I have sold MORE than 100 and LESS than 300 (which is the SUM of PURCHASE 1 & PURCHASE 2) I need the formula to choose value of G41 (PURCHASE 2 COST) AND SO ON...
The formula I have come up with so far is this:
=INDEX(41:41,,IF(C41<=D41,COLUMN(E41),IF(C41<=D41+F41,COLUMN(E41)+2,IF(C41<=D41+F41+H41,COLUMN(E41)+4,COLUMN(E41)+6))))
This formula WORKS but only for the first 3 PURCHASES.
I need a formula that has no limit but I don't know how to make a VARIABLE formula.
Please take my words literally when I say that I wouldn't waste one minute on trying to solve your problem with your current sheet design. You would need VBA, and then extract quantities and prices from each purchase without the ability to filter on columns. (Minute is up.)
What you need is a Purchase database: ItemID, Date, Quantity, Price, maybe Ref#. From that you can pull out the transactions for any item by filtering on the item and the cost by using functions like SUMIF. However, this just brings the real problem within reach without solving it.
The problem is that when you buy 100 pcs #42 your price is 42. Then you buy another 100 pieces #46 your average price is 44. But if you sold 50 pieces with a cost of 42 then the average cost of the remaining 150 is 45. Therefore you can't determine the average cost of any remainder without knowing the quantity sold and the average cost applied to that sale. To solve that problem you will still need VBA but the suggested db format of purchase record would at least support such a solution.
Not so long ago I programmed a solution where there were additional columns in the db and each sale was recorded in 3 columns (much like your present purchase record): date, Qty, Ref. In this way I could trace the sale of each individual purchase (this was for shares trading). The sale of the newer quantity wouldn't start until the earlier quantity was sold out.
Perhaps you don't need to trace where the purchased quantity went to and just need one column to count down the balance to zero. That would be much simpler but has the drawback that you can't roll back errors. In the end the rollback was the reason why I abandoned the design. The key to the ability to abandon it is a similar db for sales: date, qty, price, Ref#.
With such a setup you might design a system to either extract the average or FiFo price from the purchase side and associate it with a sale. If the condition is that it should be done with worksheet functions you could add a column for "current cost" in the purchase db, changing with each purchase, which you look up by date from the sales side using VLOOKUP or SUMPRODUCT, having set a cost price applicable from the day of purchase until the next. If that appeals to you, a method must be found to deal with days on which there are both purchases and sales.

Count Unique Entries in a Month for Pivot Table

Good afternoon,
I'm currently working on setting up a pivot table for chart that outlines an Average Revenue per Person by Line Type. Using the pivot table, I can sort everything out, but when I try to get a count of person, it adds all instances of that person's name up. What I want is that if the person's name appears once in a month, all other instances in that month of the person's name are not counted. But during a new month, the person's name will appear once more. So, it is somewhat like a unique count, but only unique per month.
My excel table looks something like:
A B C D
Date Person Revenue Line Type
1/1/2015 John $100 Toy
1/6/2015 Phil $200 Toy
1/6/2015 Jane $25 Garden
1/7/2015 John $50 Electronics
1/25/2015 John $10 Electronics
2/1/2015 John $10 Toy
2/17/2015 Phil $30 Garden
2/20/2015 Bob $500 Electronics
2/21/2015 Jane $100 Garden
So, as you can see, a person's name can occur more than one time in a month, and in more than one month. Currently, the code I am using for my helper column (E) is:
=1/COUNTIF($B:$B,B2)
This has only been giving me a count of patients throughout the entire year, not taking new months into account. I also have attempted this formula:
=IF(SUMPRODUCT(($B$2:$B2=B2)*($A$2:$A2=A2))>1,0,1
This only counts values that occur on the same day. I've tried adding in MONTH() checks and such, and am only getting syntax errors. I'm not sure where to turn for this one. Thank you!
Thanks to #TomSharpe's advice, I added a helper column to concatenate Month/Date and the Patient's name like so:
=MONTH(A2)&"-"&B2
Then used the original formula (below) to COUNTIF divided by 1.
=1/COUNTIF($B:$B,B2)
This gave me exactly what I needed.
Thanks again!

Constantly changing list of data in excel with a data validation list

I have a piece of coding which will order a list of people in order from the highest to the lowest performance (in percent). This means that if a person performs well and the person value goes up, they will then go up the list of people, this coding is as follows:
=IFERROR(INDEX('[Filename.xlsx]Sheet'!$A$4:$A$1000,MATCH(LARGE('[Filename.xlsx]Sheet'!$AS$4:$AS$1000,ROW()-4),'[Filename.xlsx]Sheet'!$AS$4:$AS$1000,0)),"")
dragged down
The coding above works from a piece of coding which ranks data so the higher the data, the higher the number will be:
{=IF(AR4="","",SUM(1*(AR4>$AR$4:$AR$1000))+1+IF(ROW(AR4)-ROW($AR$4)=0,0,SUM(1*(AR4=OFFSET($AR$4,0,0,INDEX(ROW(AR4)-ROW($AR$4)+1,1)-1,1)))))}
dragged down
So the code above pulls through the employees unique ID dependent on their performance percentage.
With the unique ID, I have used VLOOKUPS to get the rest of the data to come through with it, including name, country, sector etc...so if a person performance goes up, they move up the list and the correct data is kept on the same line.
Now the problem I am having is I want to assign manually these people to a job role using a data validation list in a new column that is where the problem begins.
So I have added a column where each cell contains a data validation list so when I give a person a job role...and somebody moves up the list, the rest of the data moves down BUT, the job role/data validation stays in the same cell and does not move down with the data. I was wondering if there is any way to counter this and make it so when a job role is attached to an employee it will move with that employee.
An example of the above:
Unique ID Name Country Performance JOB ROLE
123456789 tom UK 90% BOSS
987868564 bill USA 76% SALESMAN
162537456 steve sweden 52% WORKER
Now, in a case where steve gets 99% performance:
Unique ID Name Country Performance JOB ROLE (List)
162537456 steve sweden 99% BOSS
123456789 tom UK 90% SALESMAN
987868564 bill USA 76% WORKER
Notice the job roles stay in the same place? - Tom should have the BOSS job role, bill should be a salesman and steve should be a worker.

Statistics for people's shoppings

I am building some project (website) on people's shopping (stuff stored in refrigerator) . I need to generate an automatic shopping cart based on people's shopping .
For example if some person buys every week one bottle of milk , than the website will offer the person to buy milk once a week (if there is no milk in refrigerator) .
I am storing shopping history of each family.
But for calculating the shopping cart i need to generate some statistics formula . But i have no clue how to do it. because there might be scenarios (for example birthday) , when the family will buy more products than needed, and it will make me false data for statistics. I want to ignore such scenarios.
Anyone has idea how and what statistics should i use?
pseudocode
assuming the customer had an account and your database is MySQL
every purchase must save customerid, product id/name ,date of purchase,comment(optional) to a table (e.g. purchased table)
customer has their own table that includes at least their personal info(e.g. customer table)
lets say customer browses the product (viewing the website)
• customer clicks the product
• system/server counts the number of purchase in purchase table
• if the number of purchase is more than one then
- get the last date of purchased product - the current date purchased product = frequency of product needed by date
- total number of product purchased / total number of times the product purchased = frequency of product needed by item count
UPDATE
I would suggest that the purchase table has a field that specifies if the current order/purchase is an occasional field instead, so it would be excluded.
example
• system/server counts the number of purchase in purchase table if the purchase is not occasional

Resources