I am trying to create a calculation table for prices based on QTY and price break tier. I have an IF formula that doesn't seem to be working correctly and could use some help! Below I will post a screenshot of the table, the formula I am using, and amplifying details:
Price Break formula: =IF(H3<=24,C3,IF(25<=H3<=99,D3,IF(100<=H3<=499,E3,IF(500<=H3<=999,F3,IF(1000<=H3,G3)))))*H3
Amplifying Info: Column "H" is derived from a sum of "J:P". What I want to do is automatically calculate the total quantity requested (Column "H") and based off of that value calculate the total price of each item in Column "I". IE if the total QTY=1 the price would be 1xC (Associated cell C3:C14); If the QTY=600, then it would be 600xF. Currently the formula only works if I manually input "1" as the QTY and no other numbers work. Column "H" is set as number (though general did the same thing). If i place any other number or what the calculation comes out to it puts a dash as shown in the picture.
I'm not sure if there is better way to do this with VLOOKUP or another function?
Try using MATCH and CHOOSE:
=CHOOSE(MATCH(H2,{0,25,100,500,1000}),C2,D2,E2,F2,G2)*H2
The MATCH will compare the qty (in H2) to the values in the array ({0,25,100,500,1000}) and return a number (1 to 5).
The CHOOSE will then take this number and choose the nth value from the list of cells (C2,D2,E2,F2,G2)
We then multiply the value in the chosen cell by the quantity in H2
Related
I am using an array formula to find the largest value within a given month. Photo below ('Range of values') shows the values for each month, and I am selecting September as the criteria ("K5" in the formula below). Cell K5 will change based on the specific month I am looking for:
Formula:
{=MAX(IF(E8:P8=K5,E12:P21,""))}
Result:
63,490
Requirement:
I need to have a cell with the result, and a cell next to it with the corresponding 'Location', which in this case would be 6.
What would be the best formula to use in the case where you are not confined to a single column for the value lookup?
Typical Vlookup and Index/Match as I understand are limited as they require a single column to look up a value. The array is outside of that scope, but I feel I may be overthinking it, but I don't know.
if you have Excel 365 current channel you can use this formula to return both values:
=LET(data,A1:D5,
selectMonth,B7,
dataMonth,CHOOSECOLS(data,1,MATCH(selectMonth,CHOOSEROWS(data,1),0)),
TAKE(SORT(dataMonth,2,-1),2))
The basic idea is to first reduce the data range to the first column and the month that should be evaluated.
Then sort that "range" descending by the months values (= column 2 of new range) and take the first 2 rows (including header) - as this is the max value.
I have an excel spreadsheet where I record the current prices for some products I'm interested in.
The headers are the product names and the index are timestamps, each cell contains a price if the product is in stock at the time, or "0" if it isn't.
Basically what I need is a formula I can apply to the entire spreadsheet that can compare the value of a cell to the most recent, non zero value from that same column, so that I can easily tell if prices have changed.
In the screenshot below I want the cell with the "4958.13" value to be filled red so I can tell the price for that product went up:
I need one formula for price increase and another one for price drops.
Use formula in CF for price increments:
=(LOOKUP(2,1/(A$1:A1>0),A$1:A1)<A2)*(A2<>0)
for price decrements:
=(LOOKUP(2,1/(A$1:A1>0),A$1:A1)>A2)*(A2<>0)*(SUM(A$1:A1)<>0)
Apply to exact range.
I have a table to calculate the price of a project, where one column is the description of an element of the project followed by a column for its unit (usually hours), the price per unit, number of units, and the final price,
sort of like this:
My question really only involves the highlighted cells. Im making a template, and I add elements to the table as I go along, so some rows are left blank, but I want the total number of hours to be displayed in D7 (easy enough, =SUM(D2:D6)), but my problem is that some of the elements aren't written per hour (eg. row 4), so I want the total to only show up if all the values are for hours. Essentially:
IF all values in row B are "Hours", then sum of row D, else "")
I guess in short, is there a formula I can use that would return TRUE if all the values in a range are the same, excluding blank cells?
Thanks.
As per your last comment, you can try:
Formula in D7:
=IF(COUNTIFS(B2:B6,"<>Hours",B2:B6,"*")=0,SUM(D2:D6),"")
I am trying to create a formula that will compare the value in one column and give the lowest value in another column.
For example if column A has a product code and column B has a price, how can I get column C to compare the values in column A to give the lowest stock price for each product code?
There's no MINIF (that's min if, not mini f) function (yet?), so back to the old days when one had to use array formulas before COUNTIF and SUMIF came about:
=MIN(IF($A$2:$A$8=A2,$B$2:$B$8)) in C2 and drag down. Be sure to enter as an array formula using Ctrl+Shift+Enter instead of just Enter
I have a table set up as follows:
Column 1 - Customer Name
Row 1 - Item Name
Row 2 - Item Cost
Row 3+- Item Quantity
How do I set up the last column to calculate the total cost for each customer? I.e, For each customer row, I want to multiply the number in each cell (= quantity) by the corresponding cell in Row 2 (= cost), and add them all up for the final bill.
To clarify what I'm saying I'm attaching the following picture so that we can discuss specifics.
Have you tried SUMPRODUCT - it does exactly what you need, gives the sum of 2 or more multiplied ranges?
=SUMPRODUCT(A71:C71,$A$2:$C$2)
You can extend the ranges as far as you need. If you want to add columns make sure you don't add at the end, e.g. if you retain one blank column (D currently) and include that in the formula, then if you add a column at D the formula will automatically extend to E
You can use sumproduct but specify the ranges, e.g. =sumproduct(B2:B6,C2:C6), the next row would then be =sumproduct(B2:B6,D2:D6) etc. I'm sure there's a way to "fix" your cost row but it's quite quick doing it this way
If, for example, your first data set is in column A (i.e. per unit cost) and the second data set is in column B (i.e. quantity), and you want the total cost for each item for the specified quantity, place the following formula in C1
=A1*B1
Select C1 and drag the fill handle - this is the small
black square at the bottom right corner of the cursor as far down the column as you need. The program will automatically replicate the formula with the correct cell numbers for each row.
One way is to use this formula:
=SUM(B4:B5)*B2+SUM(C4:C5)*C2
It is not so cool but you still need to expand the formula even with SUMPRODUCT because the range has to be the same as far as I know.
The other way I came up will use a matrix function called MMULT and here is the example:
With this array (means you have to click Ctrl + Shift + Enter altogether) formula entered into cell D6: =SUM(MMULT(B2:C2,TRANSPOSE(B3:C5))), you will get your expected result without needing all the subtotals. Please note this is a 2 x 1 By 2 x 3 Matrixformula.