EXCEL - IF statement, with words - excel

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

Related

Excel formula to find a number within a range of numbers and return a date

First time writing one of these, so I will try and explain what I'm trying to do in an understandable manner.
I'm trying to create a spreadsheet to track when a premium bond wins, and have it return the date that the winning premium bond was purchased. Because premium bonds cannot be purchased singularly, when you buy them your bond numbers are given to you a range (eg: 111AA111111- 111AA111210).
As this is the data they provide, I've set my spreadsheet up with purchase date in column A, first number of the range in column B, and last number of the range in column C.
Sample image of the sheet with example bond ranges and purchase date:
Now on a separate sheet I've listed the wins, with win date in A, winning bond number in B, and prize amount in C. In D or E I would like to somehow get it to then give me from the first sheet the date of purchase that winning bond was from.
Sample image of the sheet with winning bond numbers and month they won:
I've done a lot of googling and found similar threads to do this, but none of them have been quite what I want and I've not yet been able to work out how to tweak them into doing it. These have used index and sumproduct, but I'm yet to get it to work.
Any help in the right direction is greatly appreciated. If this doesn't make sense let me know and I'll try and explain it better.
So, like this:
INDEX($B$3:$B$5,MATCH(C9,$C$3:$C$5,1))
Not added a constraint to limit to the upper value, but you could.
This answer is pretty much the same than #SolarMike's answer but based on a diferent point of view.
If the pattern is always like 111AA111111 where 1 is a numeric value and AA is a text value and unique then you can extract the text part from each id using function MID and search for it with INDEX and MATCH:
Formula is:
=INDEX($A$1:$A$3;MATCH("*"&MID(B9;4;2)&"*";$B$1:$B$3;0))
But for this to work each AA must be unique.

Substract a cell (if it has a # value) with rows below it in a different column if the conditions are the same

I'm using this equation =IF(K2=0,0, K2-I2) to show the difference in a cell with what a client has to pay vs what he has paid (negative if he paid less than what he had to and positive if he paid more). How would I modify this equation to substract from the next amount paid (k3 in this case) or the following (k4) if they didn't pay in k3 so the difference becomes 0 if its used with the added condition that the name at Column C matches.
The first column is the amount someone needs to pay, the second is what they paid, the fourth shows the difference and the fifth states what it is. I would like the difference from the first row to use the paid amount from the second row to substract from it before applying itself to the difference in the second row. Is this possible? I've tried looking for hours in google with no luck.
Edit:
This is how I would like it to look (this is manually inputting the data). The amount the client has to pay each month is 425.65 so the second month he pays 400 it would first cancel the first 'debt' to then count towards his second month payment which results in more debt than the first pay cycle.
Prelim
Worksheet here / screenshot below refer.
If you don't mind using a 'helper' column (I don't see any other way around this, unless you go down the 'VBA/Pivot' route, given the nature of the sum function re arrays) - then this should (I think!:) address the issue...
Eqns
Helper
=IF(OR(B3<>B4,SUM(D$3:D3*(B$3:B3=B3))>=INDEX($C$3:$C$11,MATCH(B3,$B$3:$B$11,0))),1,0)
This turns 1 when the sum of "Paid" is at least >= "Owing" for the same individual. Assumes: rows ordered chronologically, grouped by 'Person' attribute.
Net ultimate
=IF(B3=B2,"",SUM(D3:INDEX($D$3:$D$11,MATCH(B3&1,$B$3:$B$11&$E$3:$E$11,0))))
Screenshots
This sums from the first instance of 'Paid' for a given Person, to the Paid value corresponding to the first instance of a '1' in the Helper column.
Examples
In this case, A owes £1k at outset, pays £450 initially, then pays a further £700 (i.e. has overpaid by £150). As such, the 'Net ultimate' figure reports back £1,150 (=£450 + £700); it doesn't consider the £50 (did you want it to? If so the function becomes a lot easier, and reduces to a regular sumifs...).
For B: net ultimate = £1,025 (the total amounts paid never exceed what is owing, so tally all amounts paid by B)
Same goes for £1k and C....

Multiple Criteria If Condition - Identify highest number based upon preceding criteria

I am trying to build a bit of a tracker within Excel/Google Sheets to identify which 'home loan' has the combination of highest interest rate PLUS loan/mortgage size.
The formula I've built so far works for the below conditions;
There is only 1 loan with the highest interest rate, or;
If there are multiple loans that have the highest interest rate, the loan that is the largest is included within that condition.
Where this formula doesn't work is when;
When there are multiple loans with the highest interest rate, however these loans are NOT the largest loan size... I believe the issue is due to the fact I'm including a 'max' statement as part of the match condition. Please see cell reference I8:L10 as an example.
I'm unsure how to achieve this within a formula to identify;
The loan with the highest interest rate
Of the loans with the highest interest rate, which has the largest mortgage/loan size.
Please note the Interest Rate's vary within the data set
Formula Used:
=if(countif($E3:$H3,max($E3:$H3))>1,
if(iserror(index($E$1:$H$1,match(1,(max($E3:$H3)=E3)*(max($A3:$D3)=A3),0))=I$1),"Inactive","Active"),
if(index($E$1:$H$1,match(max($E3:$H3),$E3:$H3,0))=I$1,"Active","Inactive"))
Link to spreadsheet
https://docs.google.com/spreadsheets/d/1GHN8-uX4RdkMz0IIvTTxB0TjAKtUMSdCTFHqXNgHVm4/edit?usp=sharing
Thanks in Advance!
You can use =FILTER($E3:$H3,$E3:$H3-Max($E3:$H3),"") to create an array of all loans with the highest interest rates. I suppose it ought to be possible to create a matching array of loan sizes and then extract the highest of these. However, the task appears intimidating.
Meanwhile I wonder if this much simpler approach will allow you to get to your desired result using simple IF functions.
=IF(A3=MAX($A3:$D3),"Hi loan","Low loan") & " / " & IF(E3=MAX($E3:$H3),"Hi Rate","Low rate")
You chose "Active" and "Inactive". I chose "Hi" and "Low". Both of these are translations of True and False and may be used in conditional formatting, for example, where you simply highlight loans with the highest interest rate in one colour, and choose a different colour where the highest rate is applied to the largest loan. The simple logic I express here can be expressed in words, too. It's just a matter of interpreting the two results provided by my formula to best suit your needs.

Excel: Formula to help calculate profits

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

Excel - Way to calculate paying salaries

I work at a restaurant chain with about 170 employees. Currently we pay most of them by cash, and our administration team counts 'what bank notes' to pay them manually.
So for example if one of our waiters gets paid 2152 Euro, then the function should calculate the following:
100 Euro * 21
50 Euro * 1
2 Euro * 1
Anything like that in excel?
This is just one way to do it. I chose to use a helper column to keep the formulas simple for you
Here is how it looks:
This formula goes in B3 and you should drag it down. This column shows the remainder due after each note. E.g. 52€ remaining after 2100€ in 100€ notes has been accounted for)
=MOD(B2,A3)
Then place this formula in C3 and drag it down
=IF(B2<>B3,(B2-B3)/A3,0)
That will give you how many of each note to dispense to the worker.
Note
This method simply assumes you want to issue the fewest notes. It would be a good idea to have a table which allows you to indicate if you are out of a particular note so that the model uses 2x€50 notes rather than 100€ notes, for example.
Perhaps you can try to use Truncate & Divide to calculate number of notes for each given note.
for example, to get number of 100 note:
NumberOf100Note = Trunc(givenAmount/100,0)
NumberOf50Note = Trunc((givenAmount - 100 * NumberOf100Note) / 50, 0)
etc. and etc.
and you can build these very easily in excel, isn't it?

Resources