If the data in column A is found in multiple rows, look at the data in column C for those duplicate rows. Whichever is highest value in C, return the value from the respective row but column B. In my picture, I'm trying to populate the stuff in yellow automatically, ideally with formulas in excel. Any help is greatly appreciated.
enter image description here
My first attempt was this (a formula that you may copy on cell D2):
=INDEX($A$2:$C$9,MATCH(MAX(IF($A$2:$A$9=A2,$C$2:$C$9)),$C$2:$C$9,0),2)
This is what it does: the combo INDEX-MATCH does what VLOOKUP does, but it is more efficient than VLOOKUP. Basically it commands Excel to navigate the $A$2:$C$9 range and then find the following match:
Find the row with the MAX price for the same Item (this part: MAX(IF($A$2:$A$9=A2,$C$2:$C$9)));
Then return whatever value is on column B, at that row.
Albeit this formula seemed to work, I tried something out: what if, by some unfortunate coincidence, the MAX price for two items was the same?
This is what happens when CDE888 sells for 217
Thus, one can tell the formula above is wrong and needs a fix. This is the new formula:
INDEX($A$2:$C$9,MATCH(A2&MAX(IF($A$2:$A$9=A2,$C$2:$C$9)),$A$2:$A$9&$C$2:$C$9,0),2)
This time, the formula looks for a value that is composed of the Item code AND its highest price.
The rest works exactly as the first formula.
One last word: I wrote this formula on cell D2, then dragged the formula down.
Related
Hi there,
I want to be able to fill in data in the right hand table based off values entered in the log on the left.
So for example, column GL contains data from FR13, FR40, FR60, FR94 (every 27 rows), and rather than always type in '=FR' followed by the row number I'd like to drag down a formula to return the values.
I would also like to be able to drag the formula down the column
I have tried using ROWS and INDEX but it hasn't quite worked.
Many thanks for your help
Tried using ROWS and INDEX, expecting it to select the cells I wanted, but the pattern failed.
I'm trying to create an attendance tracker and need help with a small tweak to a formula.
Right now I'm using the following formula:
=IF(sum(G13,H13)=0,"TBD",AVERAGE(G13,H13))
Assume there are two cells (Day 1, Day 2)
Certain numbers are entered into the cell depending on if present (1), late(0.5), or absent(0).
Right now the formula is set to put "TBD" if no data is entered into a cell. As soon as a number is entered it will average the two cells together and give a percentage in another cell. The issue I'm having is if someone is absent both days. In that case it will still give a "TBD" in the final cell and I can't figure out how to get it to only give TBD if the cells are empty. If a 0 is put into a cell I want it to average it likes it does for the others.
try:
=IF((G13<>"")*(H13<>""), AVERAGE(G13:H13), "TBD")
first of all excuse my poor English, I'm trying to get the exact words to summarize my problem.
I'm trying to make a formula to concatenate a big range of cells by alternating its crossed values.
If you see the image, I have some titles (3rd row), and some variable values for each column from B to D, in the rows 5 to 7. The number of columns and rows will expand in actual project. Then, I need to summarize all crossed data to make some processes later: I need the output written at column F, where I get the title and then the cell value.
If I use =TEXTJOIN(",";;"$B$3:$D$3;B5:D5) I get the output at H5, but It makes me to get many problems later at processing information.
I have tried to make some extra columns or cells concatenating content of each "title" and "value", and then, joining everything, but it's a poor solution if I'm trying to build a sheet with hundreds of columns. I'm sure there would be another better solution, but I can't figure out by now.
your formula should be:
=ARRAYFORMULA(SUBSTITUTE(REGEXREPLACE(TRANSPOSE(QUERY(TRANSPOSE(
IF(B5:D<>"", ","&B3:D3&","&B5:D, )),,999^99)), "^,", ), " ,", ","))
I'm trying to find a way to calculate the number of unique strings in a single column, excluding blank cells. So far I've seen solutions such as the following:
=SUM(1/COUNTIF(X2:X99;X2:X99))
Plus another similar formula using FREQUENCY instead of COUNTIF. However, applying this to my spreadsheet gives me a decimal value that has no apparent meaning. For example, if my column contains 20 cells containing "ABC", and 30 cells with "XYZ", I should have an output value of 2. However, this is not the case, and even I can clearly see that the above formula won't output anything larger than a 1, which has left me rather confused as to its usage.
Pivot tables seem to show the most promise, but I can't get that to work either. Here's what I tried:
Select the column, including the header
Select a new pivot table and use the selected range
Drag the header from Available Fields to Row Fields
Select the ignore empty rows option
Create the table
This then creates a table with one row per unique entry in the first column, and an empty second column. One row below is a Total Result cell, with the adjacent cell empty.
From this, I can see that there must be some sort of capability of the software to find unique strings, so it would stand to reason that there must also be a way of counting them and displaying that value in a cell. The question is, how do I do that?
Your first attempt should work if (a) wrapped in SUMPRODUCT and (b) the range does not contain blank cells:
=SUMPRODUCT(1/COUNTIF(X2:X51;X2:X51))
If is possible with the if(indirect formula to give me the value from the same row but from a different column if a specific cell is from that row?
More specific: I want cell =Sheet2!F23 to give me =Sheet1!N11 if =sheet2!C23 is from Sheet1!B11.
The important thing is the I need it to come from row 11 but from a different column.
Thanks in advance.
I did the following:
On Sheet 1 i gave all the rows a unique number in column A
On sheet 2 i just put in the unique number(C23) and the rest of the cells on that row used the formula below with. The only thing i needed to change was the index of which column needed to be matched.
It might not be the most efficient way but i worked for me.
=IFERROR(INDEX(Sheet1!B:B;MATCH($C23;Sheet1!$A:$A;0));"")