Excel - Way to calculate paying salaries - excel

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?

Related

How can I determine the 'total cost' from a tiered pricing structure using standard formulas in Excel?

I'm trying to evaluate various tiered pricing structures (for say, electricity plans) using Excel (more-or-less) to see what costing/plan is 'optimal', given some existing usage data I have.
Consider an example 'Table of Usage & Rates' (with fictitious but easily manipulated values):-
For a daily usage value of 120, we'd have 100 (in the 1st tier) and 20 (in the 2nd tier). The amount used within a tier gets charged at a certain rate (the 'factor')... and each 'tier charge' is addded together to form a total charge for the day.
So, we can calculate:-
100 x 8 = 800 ...a part of the total
20 x 4 = 80 ...another part of the total
...and that's all, giving a total of 880.
...but how to do that in a single formula within a cell?
I've done some pretty decent explorations for a few hours today, as I can't nut out how to deal with this... and most suggestions talk about multiple =IF formulas (cumbersome and unscalable - I shouldn't need to recode cell contents if I split/add another tier)... and suggestions with =VLOOKUP just don't 'click' with me ( = I don't understand them).
I'm actually using 'PlanMaker', a component of Softmaker's 'Office 2021' product to create/maintain this spreadsheet.. and there is no VBA-like plugin available.
I'd appreciate a method of attack, if anyone can suggest something, please...
So:
=product(10,8)+product(20,4)
or if we assume Factor starts in B9 then =product(A9,B9)+product(A10,B10+product(A11,B11)
then take the sum of those results etc assuming A9 is the amount used.
You can also use:
=sumproduct(A9:A11,B9:B11)
for the same but only needs one cell. And the advantage of a lot less typing.
You can include a 3rd array in sumproduct (or as many as needed) such as a binary value to include in the calculation or not.

Is there a way I can count a specific string (Product) in a column times by the neighboring cell (Quantity) so show how much of a product I have sold [duplicate]

I'm wondering if there is an easy way to do what I'm looking for. Basically, I have a balance sheet in Excel 2011 with a bunch of data. One specific piece of information I always want visible is the amount that hasn't been reimbursed. In other words, I have a column for the amount paid and another for whether or not it has been reimbursed (Yes/No). I want to sum all of the amounts paid where the reimbursed field is equal to 'No'.
I recognize I can sum the entire column and filter out those that have been reimbursed, but I'd like it to display the full amount regardless of what filter is on (or if no filter is on).
I wasn't able to find good keywords to describe this to Google, so I'm asking here. I would like to accomplish this in Excel, not in an external program or script.
If column A contains the amounts to be reimbursed, and column B contains the "yes/no" indicating whether the reimbursement has been made, then either of the following will work, though the first option is recommended:
=SUMIF(B:B,"No",A:A)
or
=SUMIFS(A:A,B:B,"No")
Here is an example that will display the amounts paid and outstanding for a small set of sample data.
A B C D
Amount Reimbursed? Total Paid: =SUMIF(B:B,"Yes",A:A)
$100 Yes Total Outstanding: =SUMIF(B:B,"No",A:A)
$200 No
$300 No
$400 Yes
$500 No
You could do this using SUMIF. This allows you to SUM a value in a cell IF a value in another cell meets the specified criteria. Here's an example:
- A B
1 100 YES
2 100 YES
3 100 NO
Using the formula: =SUMIF(B1:B3, "YES", A1:A3), you will get the result of 200.
Here's a screenshot of a working example I just did in Excel:
You should be able to use the IF function for that. the syntax is =IF(condition, value_if_true, value_if_false). To add an extra column with only the non-reimbursed amounts, you would use something like:
=IF(B1="No", A1, 0)
and sum that. There's probably a way to include it in a single cell below the column as well, but off the top of my head I can't think of anything simple.

Calculate Profit/Capital Gains on Sold Inventory/Shares

I have a Google Sheet (Excel formulas apply) containing 2000 transactions that are structured like below:
Link to Google Sheet with example calcs here.
I need to calculate the Profit (ie. FIFO Capital Gains) for every sell order and place this amount in the 5th column (as pictured). This can be achieved with either traditional formulas or with a Google App Script. Preferably in Google Sheets.
I'm finding it difficult via formulas to match the sell order with the buy as you proceed down the table as some sell orders are split across multiple buy lines. If anyone could help with a formula or solution to tackle this problem it would be much appreciated. This is an updated question to the original here.
PRELIMINARY CONTEXT
Screenshot below refers:
Google sheets here
IMPORTANT UPDATE: re: 2000+ rows, see link in my last comment (for OneDrive template, s.t. expiry, and bottom of this proposal for screenshot of error "too large to import")
fyi: (Office 365 - Excel - fns. such as 'filter' etc., so #Name! will be ubiquitous upon opening this link; however, sharing this should serve as a convenient means to replicate above screenshot in the correct version of Excel)
REQUIREMENTS
Office 365
Adequate space to the right or ability to utilise extra sheet for calcs as req.
APPROACH
High-level | Take-aways
• Relies on 2 additional tables: Qty 'depletion' table (here - G:P) and corresp. Profit Vectors (here - R:Z)
• Compressed representations (2x2 tables, per Summary Tables, here: rows 19:32) could be explored to simplify matters (albeit these are still Work in Progress ['WiP'])
• VB could be attractive alternative too
Low-level | Procedural
Single-cell function could not be found without exceptional complication (however, suspect it could be possible e.g. using FilterXML?)
Qty label transposes filtered negative quantities (grey shaded, G3: J3)
These values are depleted in turn (from left to right, i.e. dependency on having data sorted in ascending order by date (in this depiction, data first sorted by 'fruit' as these are assumed to be independent in the context of the profit calc.)
For example, -5 quantity (G3) offset by +10 (B3) to yield +5 which, in turn contributes towards the -35 qty (H3) to yield -30. No further contribution can be made (left to right); next row (5): +20 avail (given), no offset against -5 (G3, already 'reimbursed', so 20 offset against -30 (H4) to yield -10, and so forth.
Worksheet set up to accommodate longer list of fruit / profits
Result table of residual 'quantities' (~ G:J) applied to price differential to yield 'profit vectors' (R:U) which are summed against corresponding negative quantities to produce Profit score (yellow shaded cells)
FUNCTIONS
Salient functions (all of which should be available within Google Sheet, but for completeness):
1) Profit calc. (E4, drag down):
=IF(B4<0,SUM(INDEX($R$4:$AA$13,0,MATCH(A4&C4,$R$2:$AA$2&$R$3:$AA$3,0))),"")
This can be dragged down / to right as far as desired (in this case, goes to: Z13)
2) Qty table - contents (G4)
=IF($A4=G$2,IF(G$3<>"",IF(G$2=E$1,IF($B4<0,IF(G3<0,G3,0), IF(E4<0,0,E4)+IF(G3<0,G3,0)), IF(G$3<>"", IF($B4<0,IF(G3<0,G3,0),$B4 + IF(G3<0,G3,0))))),G3)
3) Qty table - headers (G2, G3 resp.)
=MID(TRANSPOSE(FILTER(A4:A13&B4:B13,B4:B13<0)),1,SEARCH("-",TRANSPOSE(FILTER(A4:A13&B4:B13,B4:B13<0)))-1)
=-1*MID(TRANSPOSE(FILTER(A4:A13&B4:B13,B4:B13<0)),SEARCH("-",TRANSPOSE(FILTER(A4:A13&B4:B13,B4:B13<0)))+1,LEN(TRANSPOSE(FILTER(A4:A13&B4:B13,B4:B13<0))))
Drag to right as far as desired / able to (this case have been dragged to col. P)
4) Profit table - contents (R4, drag down/right)
=IF(R$2<>"",IF(G3>0,0,IF(G4>0,ABS(G3),G4-G3))*(R$3-$C4),"")
5) Profit table - headers (R2, R3 resp.):
=MID(TRANSPOSE(FILTER(A4:A13&"-"&$C$4:$C$13,B4:B13<0)),1,SEARCH("-",TRANSPOSE(FILTER(A4:A13&"-"&$C$4:$C$13,B4:B13<0)))-1)
=1*MID(TRANSPOSE(FILTER(A4:A13&"-"&$C$4:$C$13,B4:B13<0)),SEARCH("-",TRANSPOSE(FILTER(A4:A13&"-"&$C$4:$C$13,B4:B13<0)))+1,LEN(TRANSPOSE(FILTER(A4:A13&"-"&$C$4:$C$13,B4:B13<0))))
MISC
Alternate solutions derived & explored include triangular frameworks
(rows 17-32).
These tabulate the interaction between values assoc.
with positive and negative quantities positive/negative quantities
(and corres. dates)
Should be noted these are otherwise unnecessary (in terms of functions, previous 'section'
Continuing in the same vein as before....
6a) 1st summary table (Qty): row and col headers (A22 - drag down, C19 - drag right resp.):
=FILTER(D4:D13,1*IF($A$21="*",1,(A4:A13=$A$21))*(B4:B13<0))
=TRANSPOSE(FILTER(D4:D13,1*IF($A$21="*",1,IFERROR((A4:A13=$A$21),1))*(B4:B13>0)))
6b) 1st summary table (Qty): running total (c19, drag down / right as req., in this case: to P19)
=SUM($C21:C21,$B22#)
6c) 1st summary table (Qty): content (c22, drag down or tonight as req.)
=IF(OR(C$20="",$A22=""),"",IF($A22>C$20,MAX(0,C21+MIN(0,SUM($B22:B22))),C21))
7) 2nd summary table (Profits): C29, not draggable
=MIN(C$21,C$21+$B22)*($B29-C$28)
Note; other features of 2nd summary table (row / col headers) follow from 1st. Also, placing '*' in the fruit selection cell (A21) returns all (this is still WiP as mentioned previously).
SCREENSHOTS FOR LARGER UPLOAD:

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

Current price by cumulative progress against discrete values

I have to implement a set of formulas in Excel whose requirements seem to defy any logical or succinct way to do them with just formulas.
Short Description:
determine (and display) a timeline of a product's "effective" internal cost each day based on 1) the price paid for the product as a series of bulk purchases, and 2) the company's per-day consumption of the product using the price paid for each purchase, until the purchased amount is consumed and then moving on to the next purchase.
Simplified Details:
We have a sheet "PurchSums" with the product's bulk purchase history: (this is actually a pivot table)
| A | B | C | D |
1: Product Name Purch Date Rate Amount
...
23: Prod-Q 12/18/2012 $3.15 123.7
24: 1/24/2013 $3.05 748.2
25: 2/27/2013 $2.86 650.0
... ...
So initially, the internal price should be $3.15/pound until the first 123.7 pounds are used us, then it should switch to $3.05 and so on.
We have a sheet "Volumes" with consumption by day: (product consumption starts on March 1st)
| A | B | C | D |
1: Product Name 3/1/2013 3/2/2013 3/3/2013 ...
...
12: Prod-Q 87.2 77.1 101.5 ...
... ...
And I need to fill in formulas for the daily price sheet "Prices", which has the product's effective internal price for each day (filled-in by hand now):
| A | B | C | D |
1: Product Name 3/1/2013 3/2/2013 3/3/2013 ...
...
32: Prod-Q 3.15 3.15 3.05 ...
... ...
Note here that the price for "Prod-Q" changed to 3.05 on March 3rd. This is because its cumulative consumption reached 265.8 pounds (87.2 + 77.1 + 101.5) which exceeded the 12/18 purchase of 123.7 pounds and so switched from its price of 3.15 to the price of the next purchase from 1/24.
More Details:
The first sheet "PurchSums" is actually a pivot table, if that helps. Unfortunately, I don't think that it does, nor that GETPIVOTDATA(..) is going to be useful here (but I would be happy to be wrong). The information in it comes from another sheet "Purchases" which is just a list of all of the purchases:
| A | B | C | D |
1: Product Name Purch Date Rate Amount
...
11: Prod-Q 12/18/2012 $3.15 123.7
...
34: Prod-Q 1/24/2013 $3.05 748.2
...
67: Prod-Q 2/27/2013 $2.86 650.0
...
Additional:
First, I would like to do this as much as possible with Formulas in the existing cells/sheets. Plus I would like to minimize the number of additional sheets that have to be added to support this, as the workbook is already pretty substantial.
Secondly, yes I know that I could do this with VBA functions, and I will do that if there's no better way, but I would like to avoid that if possible because in my experience, populating the formulas of large sheets with massive VBA function calls can lead to some significant performance issues.
I would be grateful for any ideas on how to effectively approach this.
So what you are describing is a FIFO inventory accounting system. First In First Out. You might want to read up on it here:
http://en.wikipedia.org/wiki/FIFO_and_LIFO_accounting
and here:
http://accountingexplained.com/financial/inventories/fifo-method
Basically under FIFO you are making the assumption(whether right or wrong) that the first items that you are adding to your inventory are the first ones you are going to use up in your production. As opposed to LIFO which makes the assumption that the last items that you add to your inventory are the first ones that you are going to use up. That would only require a small change in my solution but let's focus on FIFO since that is your question.
So for every day that you operate you need to figure out how much of your inventory you used up and how much you paid for that inventory. So if you bought 20 items at 50 dollars and then another 20 items at 100 dollars the next day - and on the third day you used up 30 of the items in production, you used up (20 * $50 ) plus ( 10 * $100 ) = $2000 worth of inventory. 2000 / 30 = your effective cost of the product for the day(66.6666667). This effective cost is purely informational for the day - you probably wouldn't want to use it for any accounting - although you could with some rounding corrections - it would just be an indirect way to go about it.
So my solution uses a really ugly table. Basically for every day that you operate you need to figure out how much of your inventory you are using up and how much you paid for that inventory - and then divide it by the total amount used up in the day. Something like this should work for you:
=(IF(AND($E8>G$4,$E8>G$5),G$3,0)+IF(AND($E8>G$4,$E8<G$5),($E8-G$4),0))-SUM(G$7:G7)
=(IF(AND($E9>G$4,$E9>G$5),G$3,0)+IF(AND($E9>G$4,$E9<G$5),($E9-G$4),0))-SUM(G$7:G8)
=G8*$C8
=SUM(G13:G15)/G3
These formulas are all auto-fillable. And you could add on to this table as much space as you need(and probably improve it quite a bit). A small program in almost any language could accomplish this much easier and more intuitively than excel - but this works fine.
In practice, oftentimes nobody really knows which pieces of inventory are being used up and thus how much you paid for them. But the system persists nonetheless - usually the reason many accounting practices are done are the same as why the ancient peoples of the earth sacrificed animals - because that's how it's always been done - tradition and folklore. And for the most part it serves them quite well - routine sources of protein are healthy. I could think of some better ways to do it but - alas. Good Luck.
Assuming you know how to:
display product names on every row from the pivot table
extract lower- and upper-bound interval points from the Amount values from the pivot table
sum Volumes from all previous days from the correct row for each product
cover edge cases like volumes outside defined amount intervals
use Office 2007+ tables
use named ranges
...
For the first day, you want the maximum price = the first row for a given product name:
=INDEX(PurchSums[Rate], MATCH(this_row_product_name, PurchSums[Product Name], 0))
For every other day, you want to sum Volumes from all previous days and extract the rate from matching interval of Amounts for a given product name:
=SUMIFS(PurchSums[Rate],
PurchSums[Product Name], this_row_product_name,
PurchSums[Amount above], TEXT(sum_of_previous_volumes_for_product, "<=General"),
PurchSums[Amount up to], TEXT(sum_of_previous_volumes_for_product, ">General"))
Note that sum_of_previous_volumes_for_product > PurchSums[Amount above] and all the other conditions should be met in 1 row only, so we sum exactly 1 row.
Example:
For cell E16 the named ranges would be replaced / point to:
this_row_product_name = Prices[[#This Row],[Product Name]] = Prices[#Product Name] = $B16
sum_of_previous_volumes_for_product = =SUM(OFFSET(Volumes[[#Headers],[2013-03-01]:[2013-03-02]], MATCH(this_row_product_name, Volumes[Product Name], 0), 0)) = SUM($C12:D12)
So basically you want to summarize your "PurchSums" sheet and "Volumes" ones into one that combines the date fields??
If this is the case....
In your summary sheet make a row filled with the dates
Make a column for Purchase amount
Make a column for Volume amount
Under the Purchase amount use a match / index formula like this:
=index({Select the column C from "PurchSums"},match( {Select date from third sheet},{Select date column from "PurchSums"},0))
Similarly do the same thing for the Volume column.
Hope this gets you on your way if I am not far off on what you are trying to accomplish.

Resources