What Google Sheet function can i use to Calculate Cash on Hand? - google-sheets

I have a google sheet which is like a register where I keep all purchases for a business. I have purchases made with different types of methods. I would like to specifically be able to track the amount of cash on hand at all times. I have a sheet I have created that already calculates other stuff by formulas. Here is a Public link to a demo version:
https://docs.google.com/spreadsheets/d/1mArgTCpxYajmk2bOkE3aIaDTevajYxvsQW5P2cJbb8k/edit?usp=sharing
What I need exactly is a formula that will subtract cash purchases from the on hand balance calculated by adding the Replenishment column then subtracting from the Costs field but only if its a cash purchased item.
=IF(D4:D="Cash"),=Sum(L4:L) - Sum(F4:F)
Cash on hand to reflect actual amount and deduct cost amount of cash purchases.

Why anyone would want the result escapes me but, where the row contains Cash in ColumnD:
=sumif(D:D,"Cash",L:L)-sumif(D:D,"Cash",F:F)
will add the ColumnL values and subtract the ColumnF ones.
=sum(L:L)-sumif(D:D,"Cash",F:F)
would seem to make a little more sense.

Related

what's the best way to unpivot a data to create a structured data base in google sheets

The best approach to understand what i need is taking a look at the sample spreadsheet
https://docs.google.com/spreadsheets/d/1AyqCMvbjUt3nlqvE2ZLbmPfixwh_i1nIl9HMTn4pETY/edit?usp=sharing
What i need is unpivot the data:
1st date payment
xx months depending on the months entered in Col G (here i need to round the amount of the monthly payments, and in the last payment adjust the amount, so i don't get cents in the monthly payments divided)
last date payment
i believe the best way is generate a data base ordered correctly, from there know in which date every client has a due date for his payment
The way im entering the data is as the sample sheet shows from A:J
And my expected result is in range L:P
any help on this please will be very much appreciated
This is probably best handled by breaking the problem in 2 parts. Monthly payments and First/Last Payments. I've laid out one possible solution on your sheet in a tab called MK.Idea.
I used a SPLIT(FLATTEN( technique to generate both sets of cashflows and then a simple query to stack and order them.
This formula generated the monthly flows:
=ARRAYFORMULA(QUERY(SPLIT(FLATTEN('S1'!A2:A&"|"&'S1'!B2:B&"|"&MROUND(('S1'!D2:D-'S1'!E2:E-'S1'!I2:I)/'S1'!G2:G,100)&"|"&EDATE('S1'!H2:H,SEQUENCE(1,MAX('S1'!G2:G),0))&"|"&EDATE('S1'!H2:H,'S1'!G2:G)&"|"&"Monthly "&SEQUENCE(1,MAX('S1'!G2:G),1)),"|",0,0),"select Col4,Col1,Col2,Col6,Col3 where Col4<Col5"))

change to new price but should not affect calculation with old price In Google sheet

I have a list of customers and there price of the product. I want to change the price anytime might be once in a month or once in three months or once within 15 days. I keep changing according to the market demand. my need is that my old price calculation should not affect with new price in google sheet. kindly help me with best formula or suitable link where it fulfill my need
Your first intuition should be to find how to lookup for the price for a particular customer against the table of prices you've set up for each product: so your first choice is to use the function VLOOKUP to find (vertically) the the customer in your table, then to use HLOOKUP to find (horizontally) the product, both together will give you the matching price. But now you have another problem: being able to change the price from time to time. You could use a simple approach (which avoids dates manipulations), by adding another criteria in your VLOOKUP search, which can be something like PRICE ID:
and keep it very simple: A,B,C,D...etcc for any new price. Meaning before the date, you will choose which price should be considered for the row that you're entering data for.
So to get the RATE:
= ArrayFormula(IF(LEN(K5:K) * LEN(M5:M), VLOOKUP(L3 & K5:K, {
$B$4:$B & $A$4:$A,
$C$4:$I
}, match(M5:M, $B$4:$I$4, 0), 0), ))
To get the AMT:
=ARRAYFORMULA(IF(LEN(N5:N),N5:N*O5:O,))
Spreadsheet Demo: HERE

Finding Conditional sum to determine the Units Sold Units Remaining in inventory sheet

I have a Google sheet Here is the spreadsheet which is used for determining the inventory at FIFO basis. I have different products that come into my stock and I sell them.
I bring in fruits and record entries in A to E columns using simple formulas. But the problem is here after the E columns from F to I. When the sale take place I increase the existing value in G1 and select E1, The formulas would dynamically display the selling price based on purchase price.
Say if I have sold 50 more apples then G1 becomes 550.
I am ok if the products are continuous like Green color (Apples), When the products are of different types they need to coined using SUMIFs or something else which I am not sure how to implement.
Please help to display based on yellow cells for entire table
Here is the
=MIN(C4,$G$1-SUM($F$3:F3))
Please see if this helps:
=IF(A4=$E$1,MIN(C4,$G$1-SUMIF($A$3:A3,$E$1,$F$3:F3)),0)
The formula is for F4 and needed to be copyed down.
It uses sumif for a product name + checks if current product is "apple" or one you've selected.

Google Spreadsheets: Sum over multiple criteria constrained by timeframe

Hello Everyone (this is all in Google Spreadsheets),
I'm trying to make a report where I have to sum the product of the number of Apples and Bananas bought respectively within a certain time frame by different people. The price of the goods differs, depending on who is buying them. The people who buy it do so at different times and purchase a different number of items. The formula should be extendable to include additional people in the future.
For details see this Google Spreadsheet.
I would like to get the calculation without needing steps in-between. If it makes any difference, the number of items bought on specific dates are actually in different worksheets, so they're not on the same page as in the example. I named the ranges accordingly (even though I believe/hope it makes little difference in terms of what formula to use).
Finally, if it were possible to use one formula for the total expenditures, instead of the sum over the cells above that would be grand.
I use the DATEVALUE, because otherwise I wouldn't be able to find the first and the last date of the calendar weeks. There is a dedicated DATEVALUE column in every worksheet. (Additionally, I don't have to deal with the intricacies of the date format, which gets me every time.)
I hope I didn't miss an answer to my problem and provided enough information. I can't get my head around it, I am really looking forward to your answers.
Thank you everyone :)
Greg
P.S. A picture of the sheet, if required: Apples, Bananas & €
Credit to Sennsei from the Google Docs Help Forum (Link). I quote:
I won't be surprised if this isn't the best way to go about this, but regardless, here's my take on solving your problem. Result is based on this modified worksheet.
Apples:
=IFERROR(SUM(ARRAYFORMULA(ARRAYFORMULA(VLOOKUP(FILTER('Prices/Amounts'!$J$4:$J,'Prices/Amounts'!$K$4:$K>=B4,'Prices/Amounts'!$K$4:$K<=B5),FILTER('Prices/Amounts'!$J$4:$L,'Prices/Amounts'!$K$4:$K>=B4,'Prices/Amounts'!$K$4:$K<=B5),3,0))*ARRAYFORMULA(VLOOKUP(FILTER('Prices/Amounts'!$J$4:$J,'Prices/Amounts'!$K$4:$K>=B4,'Prices/Amounts'!$K$4:$K<=B5), 'Prices/Amounts'!$B$3:$D,3,0)))),0)
Bananas:
=IFERROR(SUM(ARRAYFORMULA(ARRAYFORMULA(VLOOKUP(FILTER('Prices/Amounts'!$F$4:$F,'Prices/Amounts'!$G$4:$G>=B4,'Prices/Amounts'!$G$4:$G<=B5),FILTER('Prices/Amounts'!$F$4:$H,'Prices/Amounts'!$G$4:$G>=B4,'Prices/Amounts'!$G$4:$G<=B5),3,0))*ARRAYFORMULA(VLOOKUP(FILTER('Prices/Amounts'!$F$4:$F,'Prices/Amounts'!$G$4:$G>=B4,'Prices/Amounts'!$G$4:$G<=B5), 'Prices/Amounts'!$B$3:$D,2,0)))),0)
Expenditure:
=B7+B8
The B4's and B5's refer to the date constraints. Since the formulae contain $ signs to ensure the cells stay the same, the formula can be dragged across to apply to other weeks without having to touch the formulae. As a plus side, these formulae allows a sheet to be infinitely expandable!
Sennsei

How can I get excel to stop updating currency exchange rates?

I am trying to set up an expenses sheet for a team I am running. We compete in both Canada and the US so have expenses in both currencies. I use =GoogleFinance("CURRENCY:USDCAD") and =GoogleFinance("CURRENCY:CADUSD") so when I enter an expense in one currency, I get the current exchange rate.
I would like to be able to make it so expenses are pegged at the exchange rate on the date the money was spent. How should I go about doing this?
There are ways to lock it to the close of a specific date:
=INDEX(GoogleFinance("CURRENCY:USDCAD","price",date(2016,4,11)),2,2)
To break it down:
GoogleFinance("CURRENCY:USDCAD","price",date(2016,4,11))
Returns an array with 4 cells in a 2 x 2 array. The value we want is in the bottom right cell.
We use INDEX to find that value.

Resources