If Statement for Google Spreadsheet - google-sheets

Example
Column B is my monthly sales goal.
Columns E,F,G,H, etc are the number of sales in a given day.
When I meet my monthly goal, Column C will display 100%.
In Column D I would like to display the date asscoiated to the column of the last sale when our monthly sales goal is met.
The equation I have right now for Cell D is:
=IF(C2=100,D=

Try:
=IF(C1=100,"Day Goal Was Met","")

Related

Google sheets Product function with Month comparison

I want to multiply a range by another range in another sheet only If a month in a date from a range matches the month in another range in another sheet.
Technically:
Multiply $R$8:$R$1007 by Start!$L$13:$L$24 If ARRAYFORMULA(TEXT($N$8:$N$1007,"MMMM")),"="&Start!$K$13:$K$24
Edit: here's a sample of my tables:
https://docs.google.com/spreadsheets/d/1A0zZ1BvRnjeQQjsf4RoRGesOPNYOJWzlr9Kh2oYto-Y/edit?usp=sharing
I want the income from US dollars to another currency with conditions.
So in other words column T in sheet Transactions to be equal to the multiplication of the income in US dollars by the exchange rate in column L in sheet Start only If the month from column N equals in sheet Transactions the column K in sheet Start.
How can I right turn this into a functional formula, please?
try:
=ARRAYFORMULA(IFERROR(VLOOKUP(MONTH(N8:N),
{MONTH(Start!K13:K24&1), Start!L13:L24}, 2, )*R8:R))
Based on the limited information of your sheets. The following would multiply and sum each range if the months are matching:
=SUMPRODUCT(--(TEXT(N8:N1007,"mmmm")=Start!K13:K24),R8:R1007,Start!L13:L24)

Deal price at google sheets

I have a data of orders where there can be multiple products per one order. I struggle to automatically compute the total order price. Didn't find any formula for it.
There is what I mean:
table example
In the last column I want to see the sum of product prices with the same order number.
You can just use Sumif:
=ArrayFormula(if(A2:A="",,sumif(A2:A,A2:A,C2:C)))
Note:
At time of writing Sumifs can't be used this way so you can't add an additional condition to the formula.
To avoid getting multiple duplicate values in Total Price column (D).
My suggestion is to add another sheet to display Total Price by order number.
If you add Sheet2 and put the following formulas inside:
in cell A1 put this formula={"Order Number";UNIQUE(Sheet1!A2:A)}to look in Sheet1 and get only unique order numbers.
in cell B1 put this formula={"Total Price";ARRAYFORMULA(if(A2:A="","",SUMIF(Sheet1!A2:A, A2:A,Sheet1!C2:C)))}to calculate for each unique Order Number the total sum of all product prices.
You will get this clean table showing you the total price for each order number:

I have a list of customers, each customer has invoice dates, I am trying to average the dates between customer orders

I am importing the data from QB, with headers Customer, Date - I am calculating the Days between last purchase and am trying to take the average of those dates. What I am left with is this - How do I take the average of each separate customer?
The way I would do it is to add another column to calculate which customer the value relates to, then work out the average.
To do this, insert a column between "Days Btwn Orders" and "Average Days Btwn Orders". We'll call this "Corresponding Customer". The rest assumes "Date" is column B, "Days Btwn orders" is column C and "Corresponding Customer" is column D.
Put this formula into that column, row 2: =IF(A2<>"",A2,D1)
Then, put this into row 2 of "Average Days Btwn Orders": =IF(AND(A2<>"",C2=""),averageifs(C:C,D:D,D2),"")
Then drag both formulas down as far as you need. There's probably a way to do this in an arrayformula so it doesn't need the extra column.

How to reduce Inventory in sheet1("stock") on the bases of product sold in sheet2("sales") through google sheets script...?

In Google Sheets for inventory management, sheet1 is stock in which Product and Quantity are mentioned, sheet2 is the sale of the day. I want to automatically deduct stock when a product is written over there, if apple is sold, then it should automatically deduct one quantity from sheet1.
The sheet is here.
Some code like this:
function onedit(sheet2,A2) {
if the product in Sheet2!A2 is in Sheet1!A2:A,Subtract 1 from Sheet1!B2:B
}
In your cell B2, you can insert this formula:
= 4 - SUM(QUERY(sold!$A$1:B,
"select count(A)
where A = '" & A2 & "'
group by A", false))
Then, you can drag it down to let the formula apply to all your rows.
The formula counts the number of occurrences in the "sold" sheet of the term in the column A of the first sheet. The QUERY function returns a table with one column and two rows (header and data). the SUM is applied to it, and reduces the QUERY result to a single number.
As with all formulas, results are kept up to date by the Google sheet automatically.
Instead of having the initial inventory in the formula itself, I suggest to use a separate column, for example column C. The formula above would then start with C2 instead of 4.

How to compare data within one column in Google Spreadsheets

I need to calculate a column in google spreadsheet.
Column B is a price column (priceUSD). I want to be able to calculate if the price the following day is 5 % higher or more, then it should return a 1.
Otherwise a 0 (if price is less than 5% higher the following day)
I do not want to add more columns for this only using column D
(column A is a date column)
A B C D
date priceUSD Addres Over5
=if(B1*1,05>B2) then return 1
Maybe, in D3, something like:
=ArrayFormula(1*(B2:B900*1,05<B3:B900))

Resources