Weighted average by unique identifier on excel 2013 - excel-formula

Assuming I have 10,000 rows with different the unique identifiers such as chairs, tables, sofa etc that are repeated with different combinations of price and quantity,How can I find the weighted average price for the chairs as well as other unique identifiers without manually dividing the sum of prices by the sum of the quantity for chairs?
Example, if the data has chairs where $12,$14,$22 are the prices and 28,13,5 are the quantity of chairs available respectively to the price. Thus, there are 28 chairs available for $12 and so on.
Thanks.

It would be better if we had access to your data, but it seems that using a conditional sumproduct over a conditional sum solves your issue.
Here follows an example:
Assuming:
A = object's name
B = object's quantity
C = object's price
=SUMPRODUCT(--(A1:A10000="Chair"),B1:B10000,C1:C10000)/SUMIF(A1:A10000;"Chair";B1:B10000)
It's not very common to use a "conditional SUMPRODUCT" so I recommend that you read more about it here

Related

How to count the number repeated product purchased by the same customer based on

I have a table with
customer identifier (email)
order number (1 refers to the first order one has placed, 2 is the 2nd)
SKU is the product identifier.
I want to see a table that has two columns:
SKU
the number of times this product has been showed in both the 1st and 2nd order of the same customer. Or in other words, how many times the product has been ordered repeatedly.
Something like this:
What excel function could achieve this?
You can achieve this with a helper column using COUNTIFS, and then a pivot table:
Helper column formula:
=--(COUNTIFS(A$2:A2,A2,C$2:C2,C2)>1)
Add a value filter to the pivot table to only show rows with a value greater than 0.
You can also create a Power Pivot table to count distinct orders and create a measure to count repeat orders.
Here, column F is the Distinct count of customer and column G is the total count of customer for each SKU. Columns H and I are measures you can create with power pivot.

Count the number of cells in a dynamic range with a criteria

This is a sample of the data I have:
I'm trying to count the number of kids in a house based on the age values I have in D column. Anybody under the age of 18 is a kid. I want the values in the green box. This is obviously a small sample. The actual data is thousands of rows.
If the number of members per house is accurate, you can use
=IF(A2="","",COUNTIF(INDEX(D:D,ROW()):INDEX(D:D,ROW()+B2-1),"<18"))

Dynamic SUM formula in Excel - Volume price list analysiis

Hello I am hoping it is possible to create a SUM field on my Product order form so that it dynamically changes what values are selected. I have many suppliers who offer discounts on all parts based on hitting certain purchase thresholds. For example
Product A is $10 each, if my total order of Product A-Z exceeds $10,000 then Product A price falls to $9, if my total order for Product A-Z exceeds $25,000 then Product A Price falls to $8 Each of these price drops are represented in a field
[Item] [Description] [Base Price] [DiscountPrice1] [DiscountPrice2] [DiscountPrice3] [Order QTY]
I assume I will need to add a field that does [Order QTY] * [Price ] but that price will depend on the SUM of all of these fields.
I thought about doing 1 Sleeper column for each Price column so it gives me the overall SUM at the buttom for each column and then I just select the end price based on the multiple sums, but was hoping for something cleaner.
Thank you
Read Up on the SUMPRODUCT() function - Here is a good explanation
Use SUMPRODUCT to calculate the total cost of the order using the base price, and then wrap it in two IFs to account for the two threshholds. IF it's below 10k, use the SUMPRODUCT with the base price, if it's above 10k, use the SUMPRODUCT referencing the second price, etc...

Need help in excel formula

1) I have two tables. 1st table contains data for more then 20,000 rows and 2nd table I already have the following columns details i.e. Region, Item, Number and I just have to get the Total value of the product from the 1st table
2) There are two types of prices in the 1st table . One is Retail Price and Another one is a Wholesale price
3) In each of the regions Rep, Item and Numbers are same in most of the cases, but the Total price is different
4) I am able to get the Total price details in 2nd table through vlookup formula (After concatinating the following columns i.e. Region, Item and Number from both the tables) wherever there is an account number for retail price
5) Currently I am manually updating "Total Price" details in 2nd table for Wholesale price which is taking lot of time.
Is it possible to build a formula to get the wholesale price details in the 2nd table, since there are more then one account number, but the price is same
If the wholesale price is the lowest price for the specific item, then you can find it with the formulas MIN and IF.
Based on your screen shot:
D is the column with the list of items
I5 is the cell with the item name for which you want to find the wholesale price
F is the column with the list of prices
If you enter the following formula in cell K5, it should find the lowest price for pencils
=MIN(IF(D:D=I5,F:F))
On this link, there is an explanation if you want to use multiple criteria.
http://www.contextures.com/excelminmaxfunction.html
try the sumifs function.
It takes multiple arguments and criteria. So it should look something like:
cell value at j5 = sumifs(f3:f23, b3:b23, h5, d3:d23, i5....)
you need to mark off which rows in your first table are wholesale selling. So it should be a column of some kind. Once you do that, let's say in column G, then you add onto the sumifs function...
, g3:g23, L5)
What you're doing is summing up all of the values in column F where h5 (region) matches in b3:b23, i5 (item) match in d3:d23, and where L5 (retail type) match in a new column g2:g23.
This will find all of the values that match that criteria exactly.
Vlookup is useful, but it's harder to scale IMO than the advanced if functions.
SUMIFS is probably the better way to go on this one, but as an alternative there is also SUMPRODUCT.
=SUMPRODUCT(($H3=$B$3:$B$20004)*($I3=$D$3:$D$20004)*($J3=$E$3:$E$20004)*($F$3:$F$20004))
The * acts as an AND statement in a logical check, and each of the ($H3=$B$3:$B$20004) is a logical check. When the row is true it will evaluate to 1. When it is false it will evaluate to 0. in the end you wind up with a list of prices or 0s that get summed. The end result is the sum of everything that matches your criteria.
The danger of using this formula is that it can get labour intensive as it is performing array calculations without being an array formula.

overall rank from three ranked tables in excel 2010

I have three or four tables each of them having 4 to 7 columns.
all tables having "name" column common.
all tables having rank values but based on different columns. ie; rank values of each table differs. suppose in table1 name x got rank1, in second table name z got rank1 etc...
but I want to calculate the overall rank based on all ranking tables.
I mean, table1 can be weighed as 0.2, table2 weight 0.6 etc...so that I want to see overall rank of name x,y,z etc....
Is there any way in excel or any alternative software??
I assume you want to weight the original "scores" not the ranks.
In another table you can use a VLOOKUP to get the score from each of the other tables, multiplied by the weight, e.g.
=VLOOKUP(A2,Table1,2,0)*0.6+VLOOKUP(A2,Table2,2,0)*0.2+VLOOKUP(A2,Table3,2,0)*0.2
Where A2 is the name and assuming that each table has the name in one column followed by the score in the next.
Now you can simply rank the "new" scores
Revised suggestion:
Given your comments I think you could still do the same as my initial suggestion except weight the ranks - I don't see how that won't be valid even if some of your original ranks are in descending order and some in ascending order........but if your rank is to the left of the name you can't use VLOOKUP so I would switch to SUMIF (although INDEX/MATCH would also work, so this formula in H2 copied down gives a combined rank assuming weights of 0.6/0.2/0.2 (adjust as required)
=SUMIF(C$2:C$4,G2,B$2:B$4)*0.6+SUMIF(C$7:C$9,G2,B$7:B$9)*0.2+SUMIF(C$12:C$14,G2,B$12:B$14)*0.2
and then you can get the overall rank with this formula in I2 copied down:
=RANK(H2,H$2:H$4,1)

Resources