I have a set of sales figures that came from New Business and Upsells that I am trying to cross reference with the cost of sales effort. I am trying to add weights to the values to reflect that we consider one type of sale to require more effort, and then to calculate how much effort we really spent on each item.
Here's an example, assuming Product 1 sales effort of 600 and Product 2 sales effort of 200
Now in a simple calculation it's easy to determine how much sales effort went into each line, and therefore how much sales effort we would need to replicate these results:
Product
Type of sale
Value of sale
Sales Effort
Product 1
New business
100
100
Product 1
Upsell
500
500
Product 2
New business
500
200
But we consider that new business requires 10x the sales effort compared to upsells, so I need to incorporate that. Here's how that should end up looking:
Product
Type of sale
Value of sale
Weighted value of sale
Weighted sales effort
Product 1
New business
100
1000
400
Product 1
Upsell
500
500
200
Product 2
New business
500
5000
200
So far the best way I found of doing it was the following formula, for example for E2, then changing the value of the sales effort:
E2 = (total sales effort for that product) * D2 / (SUMIFS(D2:D4,A2:A4,A2))
I think the (sales effort for that product) could be replaced with an IFS statement to automatically pick that value given A-column value, but am I missing something? Is there a better way of doing this if I want to include it in a Pivot table with some easy to use slicers?
I am not so into Excel and I have the following problem.
I have a table like this:
Basiscally it is an example of sheet to keep track of buyed and selled cryptocoin. It does some calculation. The column title are in italian so following some details:
B column: it is the operation: BUY or SELL.
D column: the amount of money in EUR (€) related this buy or sell operation.
E column: the price of a single coin in EUR.
F column: the number of coin buyed\selled in this operation.
Then Into the I4 cell I have put the average purchase price calculated by this formula:
=SUM(FILTER(D1:D150;B1:B150="BUY"))/SUM(FILTER(F1:F150;B1:B150="BUY"))
Basically it calculate the avarange purchase price in a simplified way (and not totally correct): it calculate the sum of the total purchase price in EUR (only the BUY operation) dividing it for the sum of the purchased coins (also here only the buyed operation).
I think that this formula is not totally correct because for example the line 4 represents an operation where all my coins was tottally sold, so after the next buy operation (line 5) the new average purchase price (in EUR) should be the eur price of this operation (that after a complete sale can be considered the only operation) for the number of coin related this operation. Basically in this specific case (but this is not a general case) the D5 / F5 that infact have the value of the E5 cell.
Basically I think that the previous formula (defined into I4) should take in consideration also how much does the average purchase price weigh after each sale operation (this because after that a specific number of coins were sold --> the purchase price untill now is the same but when I have another buy operation it must be considered that are less coins).
So basically I was thinking to use this G column containing a value representing the amount of coins updated after each sale, so basically I can have 2 possibility:
There are no previous sell operation (not previous row related a SELL operation in the B column) --> the value will be the sum of the current F value and of the F value of all the previous rows.
There are at least one row before the current one representing a SELL operation --> the value will be the summ of all the F values relatd to all the BUY operation - the sum of all the F values related to all the SELL operation.
I am not sure that this is the best way to procede. Basically what I need in the G cells is the quantity of coin untill this operation (including this operation).
How can I implement this behavior? Or what could be a nice and elegang operation to solve my original problem related my original formula?
This is actually quite a complicated problem…
If you would like to show the running balance of coins, you could do it this way:
=SUMIFS(F:F,B:B,"BUY",C:C,"SHIBA",A:A,"<="&A2:A5)
-SUMIFS(F:F,B:B,"SELL",C:C,"SHIBA",A:A,"<="&A2:A5)
This will calculate your total coin position based on the sum of all purchases prior to today's date, minus the sum of all sales prior to today's date.
However, it's not so straight forward to calculate the average purchase price. When a sale is made, are you looking to deduct it from the oldest purchase first?
Sorry that it's such a messy formula, but here's the formula I came up with:
=LET(
Dates, A2:A5,
DatesRanked, RANK.EQ(Dates,Dates,1),
CumulativePurchases, SUMIFS(F:F,B:B,"BUY",C:C,"SHIBA",A:A,"<="&Dates),
CumulativeSales, TRANSPOSE(SUMIFS(F:F,B:B,"SELL",C:C,"SHIBA",A:A,"<="&Dates)),
RowCount, ROWS(Dates),
Matrix_NetOfSales, CumulativePurchases-CumulativeSales,
Matrix_PositiveOnly, IF(Matrix_NetOfSales<0,0,Matrix_NetOfSales),
Matrix_AmountsStillHeldFromEachPurchase, Matrix_PositiveOnly-IF(DatesRanked=1,0,INDEX(Matrix_PositiveOnly,XMATCH(DatesRanked-1,DatesRanked,0),SEQUENCE(,RowCount))),
Matrix_EliminateByDate, Matrix_AmountsStillHeldFromEachPurchase*(Dates<=TRANSPOSE(Dates)),
TRANSPOSE(MMULT(TRANSPOSE(E2:E5),Matrix_EliminateByDate))
)
Here, I'm using the LET function to break down the above into manageable parts. Here is what each of the above does:
Variable
How it works
Dates
Input date range from the spreadsheet
DatesRanked
In case your data isn't sorted, it ranks the dates
CumulativePurchases
This is a dynamic range that adds up all purchases that occurred before this purchase
CumulativeSales
Same thing, but for sales
RowCount
As the name suggests, the number of rows
Matrix_NetOfSales
This subtracts the sales from the purchases, as a matrix. This is important, because different dates draw upon different transactions
Matrix_PositiveOnly
Since cumulative sales may result in an entire transaction being eliminated from the calculation, we exclude any transaction that has a negative value still applied
Matrix_AmountStillHeldFromEachPurchase
This 'undoes' the cumulative operation, leaving just the portion of each transaction that still applies
Matrix_EliminateByDate
This ensures that we only apply transactions that occur on or before the date of the current transaction
Result
Finally, we use a matrix product between the cost per share per transaction, with the matrix of units from each transaction, to get the total value spent
Phew… That was a lot of work. To get the average price per coin, simply divide the total amount spent by the total number of coins (i.e. the first equation in this answer), and it should be done!
In finance (in common law countries), this solution is similar to Clayton's Rule: Which is that the newest credit(debit) is offset against the oldest debit(credit) when calculating interest… not a coincidence.
I don't have enough reputation to comment, but I don't think it's quite clear what you're trying to accomplish... if each line item has a quantity and a cost, why would you want the sum of all previous quantities? The cost per item should only be related to those items that were transacted in this line item?
I think, based on your formula in Column I, you are attempting to do an AVERAGEIF function. This would look like this:
I2=AVERAGEIF(B:B,B2,E:E)
This would make every row where B = "Buy" match each other, and every row where B = "Sell" match each other, which I think I understood you don't want. If you're wanting to weight the results based on the quantity sold, you can do that with a SUMPRODUCT:
I2=SUMPRODUCT(--(B:B=B2),E:E,F:F)/F2
Lastly, if I misunderstood this altogether, it sounds like you'd like column G to be the cumulative sum of quantity owned to date where BUYs are added and SELLs are subtracted. You could do that like this:
G2=SUMPRODUCT(--($B$2:$B2="Buy"),$F$2:$F2)-SUMPRODUCT(--($B$2:$B2="Sell"),$F$2:$F2)
New user on Stack Overflow, apologies for my lack of Excel knowledge.
Essentially I have a spreadsheet with all of our customer orders including order number, item SKU, and quantity sold on that order (see pic for example). To estimate profit margin on each of the lines, I'm trying to assign a vendor cost to the orders for each of the vendors.
For example, if we ordered 150 of SKU ABC1 from Vendor1 and 200 of SKU AB1 from Vendor2, I want to assign the cost of Vendor1 to as many orders of that SKU that equal 150, then finish with cost from Vendor 2 for the rest. This will give us an estimate of how much margin we're making by vendor.
Is each order specific to a Vendor? For example, Order 1 is for Vendor 1, Order 2 is for Vendor 3, etc.
If so, you could add the vendor to each order and then use a VLOOKUP to lookup the cost of the SKU for the given vendor. Then it should just be COST * QTY.
Also new here; otherwise, I would have just left a comment.
I am stuck and have been watching videos and googling a lot today.
My problem is that i need to calculate the tax to deduct as well as deduct the wholesale cost of the product on an excel spread sheet.
There are 3 regions east, west and central all with different tax amounts.
East is an $0.15 tax with a $50$ price deduction
Central is an $0.18 tax with a $40 price deduction
West is an $0.18 tax with a $30 price deduction
Revenue before tax - E2
Region - B2
enter image description here
I have tried =IF(B2="east",G2*0.15, '')IF(b2="central",G2*0.18,'')
I am unsure what to put in the if false slot or if I'm even on the right track.
Thanks for your time!
When facing a problem like yours it's good to remember the basic rule of Excel, "Never put data into a formula". Data belong in a worksheet. Formulas merely manipulate them. Accordingly, you need a table like this one.
Now the solution is easy - or it would be if your description was unambiguous. I presumed that what you call "price reduction" is in fact a tax free portion of the sale. So, if the value of the sale is $200 tax will be paid on an amount smaller than this. Of course, this leads to the possibility of a negative tax which is unlikely to be on offer. Therefore the formula to be employed is [Tax base] = [Sale Amount] - [Tax excempted amount], but not less than zero.
Based on the above presumption the formula below will do the job if you named the table pictured above as "Taxes". If you didn't name it, the default name might be Table1 and you can change that name in the formula.
=G2+MAX(ROUND((G2-VLOOKUP(B2,Taxes,3,FALSE))*VLOOKUP(B2,Taxes,2,FALSE),2),0)
I point out that the formula also rounds the result. This is important in a sheet like yours because you can't afford the total in column H to be different from what you see, and all you see is 2 digits.
Whenever the taxes change you simply change the table and leave the formulas in place. That part is easy. But there is one thing to remember. All the formulas of the past also refer to the table and all your old sales amounts will get "updated". So, when rates change, first Copy/PasteSpecial>Values all existing, or create a new table called Taxes2020 and start using a new formula referring to that table from the cut-off date forward.
If the price deduction if from the total for the region you should calculate it in two stages, the sum for the region, and then the net after tax.
If the deduction is per transaction I would suggest adding a lookup table and add another column to your list which will allow you to calculate all regions with the same formula.
=IF(B2="East",(G2*1.15)-50, IF(b2="Central",(G2*1.18)-40,(G2*1.18)-30))
I have excel table in csv with data from monitoring smart shelf. The shelf status is monitored every 2 mins. The data is the table with time status of products at given time during the day. Each column consists of numbers e.g. 1,4,3,2,2,2,0,0 etc. When the number is bigger than previous one (e.g. was 2 and now is 3) it means that someone added the product to the shelf, and when the number is less than previous one, it means that the product unit/s was sold.
Te problem is to construct the formula that will be count quantity sold and quantity added. I think that it should monitor the change of quantity whether is positive or negative and sum each positive and negative change.
I just started learning excel more complex formulas and I don't have any idea how to solve this problem. I count on your help
Sold
=SUMPRODUCT(A1:A7-A2:A8,--(A1:A7>A2:A8))
Stocked
=SUMPRODUCT(A2:A8-A1:A7,--(A2:A8>A1:A7))