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
Related
I am absolutly not into Excel. I have a cell containing this formula:
=SUM(D2:D33)/SUM(F2:F33)
I want to adapt this formula in the following way: it has to skip a row (do not take into consideration in the previous formula. so the D cell value is not summed and the F value is not summed) if the B cell value has "SELL" as value.
it represents something like this related to a cryptocurrency calculator:
The I2 cell contains the previous formula that calculate the average buying price. I want to exclude from this calculation the row representing a sell operation.
What can I do?
EDIT-1: tried with this formula but I am obtaining this error message:
=SUM(FILTER(D2:D6,B2:B6="BUY"))/SUM(FILTER(F2:F6,B2:B6="BUY"))
You can use SUMIF(). Try-
=SUMIF(B2:B6,"BUY",D2:D6)/SUMIF(B2:B6,"BUY",F2:F6)
Or SUMPRODUCT()
=SUMPRODUCT((D2:D6)*(B2:B6="BUY"))/SUMPRODUCT((F2:F6)*(B2:B6="BUY"))
Or FILTER() formula with Excel-365.
=SUM(FILTER(D2:D6,B2:B6="BUY"))/SUM(FILTER(F2:F6,B2:B6="BUY"))
The formula should sum up the column C based on Column A and B when two column value matches and displays the sum value only in the first cell D2 of Column D as shown in figure "60" & "67".
I am trying with SUMIFS but not getting the Output as required.
=SUMIFS(C2:C6;A2:A6;"A:A";B2:B6)
Try this formula in cell D2:
=IF(SUMPRODUCT(--($A$2:$A2&$B$2:$B2=$A2&$B2))=1,SUMPRODUCT(--($A$2:$A$6&$B$2:$B$6=$A2&$B2),$C$2:$C$6),"")
It should give expected output.
It might also be better/more efficient if you create a helper column (which stores concatenation results, instead of doing the concatenation multiple times in each formula).
I am very new in Excel and I have to implement this pretty complex task (at least for me it is complex).
I put what I am doing here: https://drive.google.com/open?id=1sWHbyl-Y-GgSiX7JJ3bJ9_y8DUts-E0e
I will try to explain exactly what I have to do:
For each rows I have to "calculate" the value of the L column in this way.
Each cell into the L column is "calculated" using the following steps:
Considers the date into the H column of this row.
Search the nearest date in the past into the A column to select a specific row.
Take the E column value of this row and use it to populate the current L cell.
So doing a practical example, I want to populate the L3 cell, I have to do:
Considers the date into the H column of this row: so I obtain the value of the H3 row that is this date: 16/12/2017.
Then, into the whole A column I search the nearest date in the past in this column (in this case it is 15/12/2017), so I select the row number 4.
Take the value of E4 cell value (598,05 €) and write it into my L3 cell.
How can I do something like this?
Thank you
This is a simple INDEX(...,MATCH()) situation.
=INDEX(E:E,MATCH(H3,A:A,1))
This will return the value in column E such that the date in column A is the greatest date less than or equal to the value in H3.
Note: This assumes the dates in column A are sorted in ascending order.
VLOOKUP:
=VLOOKUP(H3,A:E,5,TRUE)
This requires the dates in Column A to be sorted.
this is my spreadsheet, i want to create a new sheet with the following aggregation: I have a table with date column and sum column. in the sum column I want to sum the quantity of each row the date appears. For example, for 7/5/2015 it will sum B4, B5, B10, B11, B15, B17, B22, B25, B29.
EDIT: My range should contain the whole sheet, from d to infinity and from 2 to infinity and I'm using google spreadsheet
I tried this formula, but it returns error:
=LOOKUP(A2,Sheet1,sum(!b))
please try the following:
=SUMIFS(B:B;F:F;"<>")
i hope this helps,
best - AB
Or you could try my favourite function, SUMPRODUCT :
=SUMPRODUCT(SIGN((F:F=$A$1)+(E:E=$A$1)+(D:D=$A$1))*B:B)
where $A$1 holds your lookup value, i.e. 7/5/2015
Should work for both googlesheets and excel.
Didn't try hard, but maybe this works too (adapt "AA" to your last column):
=SUMPRODUCT(D:AA=$A$1))*B:B)
You could even try to automatize the "AA" part with a =MAX(1:1) (what is the number of the last column in row 1?) coupled with the OFFSET function.
Explanations here:
Sumproduct - Multiple criteria with "or"
I'm having an issue getting accurate data from the SUMIF function. This appears to be caused by the SKU and Product name being identical however I don't understand why the selected range would be ignored.
SUMIF(G:K,A2,K:K) - Cell D2 is calling for the sum of K yet returning the sum result of K2:M2. All other results in D are correct.
SUMIF(G:K,A2,I:I) - If I change the formula in D to SUM I:I (text not a numeric field) the function returns the sum of K:K
Example file http://tempsend.com/013C2B6378
According to the documentation here the range to be summed starts at the top left of the sum range (K:K in your first example) but its size is given by the size of the criteria range (G:K in your example). So I think that's why you're getting extra columns summed in your result.
If you have multiple criteria involving different columns, you should be able to use SUMIFS.
So let's say your data sit in 8 rows (including the headings).
then you simply need to change your formula to say, look for B2 in column G OR in I, if true, then sum the values in K. Right?
put this formula in B2 and press ctrl+shift+enter to calculate the formula.
=SUM(IF(($G$2:$G$8=B2)+($I$2:$I$8=B2),1,0)*$K$2:$K$8)
then drag and fill down until the last cell.
obviously you need to adjust the ranges in the formula to adapt to your own data.
tell me if you get to the answer via this.