In Google Sheet, how do I SumIf the product of 2 column multiplied - google-sheets

I basically want to conditionally sum all the rows that have same customer name. But I want to multiply the item price and order count to get the total order price. I have an equation like this:
=SUMIF(Orders!A$2:A$100,A2, MULTIPLY( Orders!H$2:H$100,Orders!D$2:D$100))
Where:
Orders!A$2:A$100 is the Customer Name Column
A2 is the current Customer Name Criteria
Orders!H$2:H$100 is the Order Price
Orders!D$2:D$100 is the Order Count
This unfortunately does not work, how do I do this?

=SUMPRODUCT(--(Orders!A$2:A$100=A2),Orders!D$2:D$100,Orders!H$2:H$100)

Related

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:

Applying discount to products based on 2 criteria in Google Sheets

I have a list of clothing products and I want to allocate a discount code to each product based on 2 criteria.
Column A is the product description, column B is the clothing season, column C is where the discount code should be generated. Then I have a table which has the rules for the discount codes: season in column F, product type in column G, and discount code in column H. Here's the spreadsheet:
https://docs.google.com/spreadsheets/d/1zwjjs55BFBtKYJdoznsjXQXGDRWpUs7lQ5lm2tnuUR4/edit?usp=sharing
So if a product is a summer t-shirt then it should be given the discount code "AAA". If the product doesn't match this then I want to continue down the discounts codes table until one of the season and product type combinations matches. The discount codes need to be applied following the strict order of the discount codes table.
I can achieve this by using the IFS formula but this requires making the formula longer and longer for each extra discount code I add to the table.
=IFS( AND(B3=$F$3,REGEXMATCH(LOWER(A3),LOWER($G$3))),$H$3 , AND(B3=$F$4,REGEXMATCH(LOWER(A3),LOWER($G$4))),$H$4 )
Is there a better way to do this? Thanks
#Tim B, try clearing Column C entirely (including the header) and placing the following formula into C2:
=ArrayFormula({"Discount Code";IF(A3:A="","",IFERROR(VLOOKUP(UPPER(B3:B)&IFERROR(REGEXEXTRACT(UPPER(A3:A),TEXTJOIN("|",TRUE,UPPER(G2:G)))),{UPPER(F3:F&G3:G),H3:H},2,FALSE),IFERROR(VLOOKUP(UPPER(B3:B)&IFERROR(REGEXEXTRACT(SUBSTITUTE(UPPER(A3:A),IFERROR(REGEXEXTRACT(UPPER(A3:A),TEXTJOIN("|",TRUE,UPPER(G2:G)))),""),TEXTJOIN("|",TRUE,UPPER(G2:G)))),{UPPER(F3:F&G3:G),H3:H},2,FALSE),)))})

Check columns, if one is bigger or equal to the adjacent cell in column A, style it differently

I have 10 columns with price data in.
Column A has my product SKU
Column B - has the cost price of a product
The other columns have other prices in them.
Link: https://docs.google.com/spreadsheets/d/17PLI_d_05uYnzOt2yL4ZQA3XB89rIz9vQJnIOBidMz8/edit?usp=sharing
I want to go through each cell in a row and see if any of the prices listed are less than, or equal to, the cost price in Cell A.
How would I write this in Google Sheets?
I believe the correct way to do this is the following formula:
=$D2:$K2<=$B2
To check if there is any price below (or equal) to a certain value, you could check the minimum price and compare that. So use the MIN function and compare that with the value at B2.
=MIN(D2:K2)<= B2
You have posted a solution but you are comparing a range with a value, and for me it does not work.

If Statement for Google Spreadsheet

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

Multiple criteria in a filter/summation combined, entered into two columns for sorting

I have a spreadsheet that tallies sales over time, including sales person, office they work out of, and the price of whatever it is that they sold. I am attempting to create a two-column filtered list by multiple criteria. The data looks like this:
Date Name Office Price
5/5/12 Joe OW 220000
6/1/12 Jim SOL 100000
What I want to be able to do is create a two-column entry that sums the price column, but uses multiple critera from the first three to do so. For instance, "everyone named Jim who sold something in May", and then I'd like to sort that by the top three.
Using items like:
=FILTER( C1:C ; D1:D="OW"; month(B1:B)=month("5/12/12"))
and
=ARRAYFORMULA(frequency(MATCH(E1:E&counta(E1:E),UNIQUE(E1:E&counta(E1:E)),0), MATCH(UNIQUE(E1:E&counta(E1:E)),UNIQUE(E1:E&counta(E1:E)),0)))
I can filter and tally, but I am unable to replace the frequency mentioned above with a summation of the price column.
Rather than using FILTER you could put together something using SUMPRODUCT:
=arrayformula(sumproduct($E$2:$E$3*($C$2:$C$3=C2)))
If you have column E as price and column C as name, this creates a new column that shows the total earnings for each name, next to every instance where that name appears in the array. You can apply further conditions within the SUMPRODUCT call as needed. You could then apply UNIQUE to deduplicate and sort the resulting table to see the top 3.

Resources