Excel: Formula to help calculate profits - excel

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

Related

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.

How do I come up with a formula to solve the following: If a cell is zero, add a number from a different cell to the total cost?

I need to add estimated costs and actual costs to a total budget. To start, we put the estimated cost of travel on the spreadsheet. When the person goes on travel, they invoice their actual travel costs when they return. We have to add the Room and A/V cost to both figures. So, when there is not travel cost invoiced (yet), I would like to count the estimated cost in the final total travel amount (amt. estimated (only if it has not been invoiced yet) + invoiced + the Room/AV Cost).
H8 Room/AV Cost
I8 Est Travel Cost
J8 Total Travel Est. (Room/AV +Travel Est.)
K8 Invoiced Travel Cost
Goal: IF(K8 has a number, (then do not count I8) and instead add K8+H8)
I've gotten this far:
IF(K8<0*(J8), K8, J8)
Everything I come up with, Excel tells me that I'm asking too much. Any help would be appreciated.
Use:
=IF(K8>0,K8+H8,J8)
which states, "If K8>0 then K8 + H8 Else J8"
I'm guessing that the cells only can contain numbers. So this should work for you:
=IF(ISBLANK(K8);J8;K8+H8)
From the top of my head:
=IF(K8 <> ""; K8+H8; J8)
Also there is a Funktion ISBLANK which you. An use to test whether a cell is empty.

EXCEL - IF statement, with words

Good afternoon,
I am looking for an Excel/GOOGLE Sheet =SUM(IF()) statement formula that will help to know if I have made or lost money in any given month. To save time when inputting the information, I would like to have once cell in the TOTAL row calculate what is a positive and negative number depending on the PAYMENT TYPE used, and printout the remainder.
This is also maintain inventory for when new items are added to my life during this one month period, because I'm just weird like that.
(See Google Sheet Link for example) ie Expense Report
ie. My expenses are arranged by in a column PAYMENT TYPE: CC (for credit card, negative), CASH (negative), GC (for gift card, not added), or DEPOSIT (for income, positive).
The "added negative/positive" is how the balances should look: red for money spent (CC, CASH), gray for no expense (GC), green for money earned (DEPOSIT).
The =sum(if()) formula would then be able to easily calculate the end result, either in red (money lost) or green (money earned).
If there is another formula outside of =sum(IF()) that would do this job, I am very interested in seeing how it would be applied, so I can learn it.
Thank you for your responses, in advance.
-ECP03
Unfortunately, my current network blocks Google Docs so I can't view your example doc. From what I've gathered, you have a a couple information columns (expense, amount, etc) and then one column that includes the payment type. Here are 2 ways you could do this:
Assumption: you have NAME (Range A1:A5), EXPENSE (Range B1:B5), and PAYMENT_TYPE (Range C1:C5) as your 3 columns with 4 total transactions. Header is the first row (A1:C1). This assumes you will never have more than 1000 transactions to keep track of; just modify 1000 to whatever new max you require.
1) This solution gives you your sum. It does not tell you the positive and negative contributions of the positives and negatives. For that see Solution 2.
Set the cell that you want your net income to be to:
=SUMIF(C1:C1000,"DEPOSIT",B1:B1000)-SUMIF(C1:C1000,"CC",B1:B1000)-SUMIF(C1:C1000,"CASH",B1:B1000)
2) This is the solution that shows both positive and negative contributions.
Set aside 3 cells (say E1, E2, and E3). Set E1 to:
=SUMIF(C1:C1000,"CC",B1:B1000)+SUMIF(C1:C1000,"CASH",B1:B1000)
This is your 'negatives' cell. Set E2 to:
=SUMIF(C1:C1000,"DEPOSIT",B1:B1000)
Set E3 to:
=E2-E1
Then all you have to do is use conditional formatting (if you don't know how to do this just let me know or Google it) to set cell E3 to be green if the amount in it is > 0, red if it is < 0, and gray if it is = 0.
Thank you, Judu Le.
That formula does the trick.
I did use your first answer.
ie. =SUMIF(C1:C1000, "DEPOSIT", B1:B1000) - (SUMIF(C1:C1000, "CC", B1:B1000)+SUMIF(C1:C1000,"CASH",B1:B1000))
The end result did not add or subtract the GC balance, which is what I wanted.
This worked perfectly. Thank you for your timely feedback.
-ECP03

Complicated formula required to work out costs including multiple discounts

I'm looking to compute and show individual row totals and a Grand Total. I just need the formulae to put in the boxes so the calculation is automatic but the problem is the calculations are a little complicated...
I'm using data validation to select the day type. This is what I think I need:
Assign a price to the day type (either Standard day = £23 or Extended day = £26).
Apply a volume discount where appropriate. If Jack is attending all week (5 days) and the day type is the same for all (all Standard or all Extended), the total cost is £100 (or £120)
Else the total number of days needs to be added up for Jack. (Number of days for each ‘day type’) and priced up.
For his siblings after the first, as above but apply an additional discount of 15%.
The grand total then needs to show at the bottom.
Well, it is not the best of data layouts but this may serve, in L6 and copied down to L13:
=IF(OR(A6="Brother",A6="Sister"),0.85* IF(COUNTIF(B6:F6,"Standard day")=5,100,IF(COUNTIF(B6:F6,"Extended day")=5,120,COUNTIF(B6:F6,"Standard day")*23+COUNTIF(B6:F6,"Extended day")*26)), IF(COUNTIF(B6:F6,"Standard day")=5,100,IF(COUNTIF(B6:F6,"Extended day")=5,120,COUNTIF(B6:F6,"Standard day")*23+COUNTIF(B6:F6,"Extended day")*26)))
and =SUM(L1:L16) in D16.
It would be better practice not to hard code the daily rates/discount, but extracting these from C1:D2 would have increased the length of the formula further.
Note also the result is not £429.95 (you may have changed your example after doing your calculations).

Calculating Percent of Total in Power Pivot Model

I have created a power pivot table as shown in the picture. I want to calculate quarter over quarter sales change. For which I have to divide for example corporate family "Acer" 's sales in 2012Q4 by sum of all the corporate family. I am using calculated measure to do this, but I am not sure what formula I can use.
My need is to create two columns, one for 2012Q4 percent of total and one for 2013Q1 percent of total. Then I will create another measure to find the difference. So the formula for 2012Q4 should be like this 1624442 / (1624442+22449+1200+16123) . Any idea which function can help me do it?
It sounds like you are measuring the change in the percent of total for each corporate family from quarter to quarter. You will need to create 3 calculated measures. I'm not sure what your model looks like so I can't give you the exact formula, but here is the idea.
CurrentQtr%ofTotal:= Divide(Sum('Sales'[Units]),Calculate(Sum('Sales'[Units]), All['Product'[Corporate Family])))
PrevQtr%ofTotal:= DIVIDE(CALCULATE(Sum('Sales'[Units]), DATEADD(DimDate[DateKey], -1, QUARTER)),
CALCULATE(Sum('Sales'[Units]), DATEADD(DimDate[DateKey], -1, QUARTER), All('Product'[Corporate Family]))))
Change%ofTotal:= DIVIDE(([CurrentQtr%ofTotal]-[PrevQtr%ofTotal]),[PrevQtr%ofTotal])
I used the divide function because it handles divide by zero errors. You use the ALL function to remove the filter on the Corporate Family column from the filter context. The Change%ofTotal is just to find the differenc. I'm calculating % change but you may just want to subtract.
Here's the link to a good blog post on time intelligence. And here's one on calculating percent of total.
For percentages please follow the tutorial on the Tech on the Net.
Adding another column where you calculate a difference between two pivot columns will not work - this column is "unpivotable", as it relies on a column defintion. You would need to copy and paste pivot as values to another worksheet and do the extra calculation there.

Resources