Vlookup doesnt read mixture of Alphabet and Numbers eg: 1T902462K01 - excel

i have a table as below and i wanted to compare result using Vlookup.
A | B | C
-------------------------
1 | ID | Name | Lot
-------------------------
2 | 70100 | Krenn | VF849062
-------------------------
3 | 70101 | Georg | VE803354
-------------------------
4 | 70102 | Mohd | VE803354
However =VLOOKUP(C2,A1:C4,1,FALSE) will result #N/A
Any advise?
Regards,
Zaiem

Try the Index/Match suggested in the comments. It goes like this:
=index(A1:A4,match(F1,C1:C4,0))
in words: find the value of F1 in the range C1 to C4 and return the value from column A for the same row.
Your Vlookup formula references C2, which does not make sense if column C is the column where you perform the lookup.

Related

Excel Formula INDEX+AGREGATE+ORDER by another column

I have an excel formula that I need help with, since I'm not that savvy on excel.
The formula is the following:
=IFERROR(INDEX(Liste!$C$2:$N$10000,AGGREGATE(15,6,(ROW(Liste!$A$2:$A$10000)-ROW(Liste!$A$2)+1)/ISNUMBER(SEARCH("BOX"," " & Liste!$B$2:$B$10000 & " ")),ROWS($A$4:$A4)),COLUMN()-1),"")
This formula looks on another sheet (Liste) for lines containing the word BOX on column B and show them on "ROWS($D$4:$D4)" (in this case) starting from Column "C".
I'm not even sure if that formula orders the results on column "B" since they're all the same with the word "BOX".
It works prefectly, the only think I can't achieve (and I've tried diferent combinations) is to change that code to make it show the results in order according to column "C" (not column B).
Sample Data:
Sheet "Liste"
|-----------|----------|-----------|
| B | C | D |
|-----------|----------|-----------|
| NOTBOX | 5 | SAMPLE |
| BOX | 3 | SAMPLE |
| BOX | 1 | SAMPLE |
| BOX | 2 | SAMPLE |
| NOTBOX | 4 | SAMPLE |
|-----------|----------|-----------|
Current Result:
|-----------|----------|
| A | B |
|-----------|----------|
| 3 | SAMPLE |
| 1 | SAMPLE |
| 2 | SAMPLE |
|-----------|----------|
Desired Result:
|-----------|----------|
| A | B |
|-----------|----------|
| 1 | SAMPLE |
| 2 | SAMPLE |
| 3 | SAMPLE |
|-----------|----------|
Can someone give me a hand?
One thing I forgot to state is that I need to drag this formula around (rows and columns) so it's important that I can drag it on a large zone (if lines are added in the future) and that it ignores the errors (blank).
Thank you in advance
Here is an example on how you could do this:
Formula in F2:
=SMALL(IF($A$2:$A$6=$E$2,$B$2:$B$6,""),ROW(A1))
Or in French
=PETITE.VALEUR(SI($A$2:$A$6=$E$2;$B$2:$B$6;"");LIGNE(A1))
Formula in G2:
=INDEX($C$2:$C$6,MATCH(F2,$B$2:$B$6,0))
Or in French
=INDEX($C$2:$C$6;EQUIV(F2;$B$2:$B$6;0))
Note: The first formula is an array formula and need to be confirmed through CtrlShiftEnter.
Drag them both down and include an IFERROR if you drag these formula's down and you don't want to see errors once there are no more hits.

Rank with condition

I'm searching for a formula which could rank a value from a subset of a range.
Let's say Col.A is Departement and Col.B is value.
I want a formula which can rank the value from all the other value of this departement.
I have tried things
{=rank(value,if(myrange=condition,myrange),0)}
Does not work.
I have managed to do the oposite - retrieving the value of a certain rank with :
{=small(if(myrange=condition,myrange),rank i want)}
I don't understand why my first formula fail.
Excpected result would be the rank of the value from it's subset of value which is all cells where the condition is true.
For such scenarios (ranking a subset of data), I find using SUMPRODUCT much easier:
=SUMPRODUCT(($A$2:$A$12=A2)*(B2<$B$2:$B$12))+1
This is for descending order. Result:
Although Excel has a RANK function, there is no RANKIF function to
perform a conditional rank. However, you can easily create a
conditional RANK with the COUNTIFS function. Exceljet
Some sample data:
| Dep | Val |
|-----|-----|
| A | 5 |
| A | 3 |
| A | 6 |
| A | 6 |
| B | 3 |
| B | 8 |
| B | 2 |
| C | 9 |
| C | 5 |
| C | 7 |
Let's put the COUNTIFS in there:
Formula in C2 for descending:
=COUNTIFS($A$2:$A$11,A2,$B$2:$B$11,">"&B2)+1
Formula in D2 for ascending:
=COUNTIFS($A$2:$A$11,A2,$B$2:$B$11,"<"&B2)+1
Drag both down....

Excel: get the value of third column on the behalf of second column

i am not much familiar with excel formulas and i am trying to get the value of third column on the behalf of second column.
Example:
|---------------------------------------------------------|
| A B C D E |
|-----|----------|----------|--------------|--------------|
|Sr.No| Bar Code | Cat Id | Org BarCode | Org Category |
|---------------------------------------------------------|
| 1 | 89457898 | | 85214784 | 2 |
| 2 | 87414714 | | 63247458 | 3 |
| 3 | 85214784 | | 89457898 | 4 |
| 4 | 63247458 | | ---- | --- |
-----------------------------------------------------------
i just want to update column C by column E on the behalf of column D and B
can any one please tell me the formula, how i can do this?
Use VLOOKUP. Enter the following formula into cell C1 and then copy it down the C column:
=VLOOKUP(B1, D$1:E$4, 2, FALSE)
To cover more than 4 rows, then just update the formula accordingly. If you want to display a certain placeholder value if a value in column B be not found, then you wrap the call to VLOOKUP as follows:
=IFNA(VLOOKUP(B1, D$1:E$4, 2, FALSE), "Not found")

Return array of all matches between two ranges

Ok so I am trying to take a common tutorial array formula a step further but cannot figure out how.
Essentially I have a set of sheets with values like below:
| Sheet 1 || Sheet 2 |
| Products(1) | Product Group || Products(2) | Data |
| | || | |
| 100 | 1 || 100 | abc |
| 200 | 2 || 200 | def |
| 300 | 3 || 200 | ghi |
| 400 | 3 || 500 | jkl |
| 500 | 2 || 400 | mno |
Sheet 1 lists all parameters that classify each product and uses those to assign each product to a group. Essentially Products is a unique index key.
Sheet 2 is a tracking list of every time that a product is run, how it did. Therefore product numbers may show up multiple times or not at all.
I have a third sheet in which a product number is entered, from that its group number is calculated, and sheet 1 is searched for all products with that group number and the list is returned using an array formula (using this tutorial http://thinketg.com/how-to-return-multiple-match-values-in-excel-using-index-match-or-vlookup/ which shows up all over on line by different people). We will call this "Column K" on Sheet 3.
What I want to do now is take it a step further and return "Data" from Sheet 2 for all matches between "Sheet 2"!"Products(2)" and "Sheet 3"!"Column K". If "Column K" was fixed I could use the same formula again and put an OR statement into the IF expression, but because K is dynamically populated I am not sure how to find them all.
For clarification, The end result that I would ideally show is like this:
| Sheet 3 |
| Product Num | Column K | Column L | Column M |
| (user enters) | (automatic) | (automatic) | (automatic) |
| 500 | 200 | 200 | def |
| | 500 | 200 | ghi |
| Product Group | | 500 | jkl |
| (automatic) | | | |
| 2 | | | |
If you compare a column vector with an row vector in an array formula then it will compare each value from the column with each value in the row. So the following will work because we transpose the values in Sheet3!K1:K[n] into a row vector before comparing with Sheet2!$A$1:$A$10000.
Sheet1:
Sheet2:
Sheet3:
Formulas in Sheet3:
In A5:
=VLOOKUP($A$2,Sheet1!$A:$B,2,FALSE)
In K2 downwards:
{=IFERROR(INDEX(Sheet1!$A$1:$A$10000,SMALL(IF(Sheet1!$B$1:$B$10000=$A$5,ROW(Sheet1!$B$1:$B$10000)),ROW(1:1))),"")}
In L2 downwards:
{=INDEX(Sheet2!$A$1:$A$10000,SMALL(IF(Sheet2!$A$1:$A$10000=TRANSPOSE($K$1:INDEX($K:$K,MAX(IF($K$1:$K$10000<>"",ROW($K$1:$K$10000))))),ROW(Sheet2!$A$1:$A$10000)),ROW(1:1)))}
In M2 downwards:
{=INDEX(Sheet2!$B$1:$B$10000,SMALL(IF(Sheet2!$A$1:$A$10000=TRANSPOSE($K$1:INDEX($K:$K,MAX(IF($K$1:$K$10000<>"",ROW($K$1:$K$10000))))),ROW(Sheet2!$A$1:$A$10000)),ROW(1:1)))}
Formulas in K2,L2,M2 are array formulas. Input them without the curly brackets and then press [Ctrl]+[Shift]+[Enter].
The reference to K[n] in Sheet3!K1:K[n] is computed with
INDEX($K:$K,MAX(IF($K$1:$K$10000<>"",ROW($K$1:$K$10000))))
therein the
MAX(IF($K$1:$K$10000<>"",ROW($K$1:$K$10000)))
gets the largest row number in column K where the content not equals "".
If the product numbers are ever numeric, then it is easier and it will be possible to have the results sorted also.
Sheet1 and sheet2 see above.
Sheet3:
Formulas in Sheet3:
In A5: see above
In K2 downwards:
{=IFERROR(SMALL(IF(Sheet1!$B$2:$B$10000=$A$5,Sheet1!$A$2:$A$10000),ROW(1:1)),"")}
In L2 downwards:
{=SMALL(IF(Sheet2!$A$2:$A$10000=TRANSPOSE($K$2:INDEX($K:$K,MATCH(MAX($K:$K),$K:$K))),Sheet2!$A$2:$A$10000),ROW(1:1))}
In M2 downwards:
{=INDEX(Sheet2!$B$1:$B$10000,SMALL(IF(Sheet2!$A$1:$A$10000=$L2,ROW(Sheet2!$A$1:$A$10000)),COUNTIF($L$2:$L2,L2)))}

Check if cells match in two columns and, if they do, copy a related value

Given a column A of 100 names and another B of numbers, where column C contains a subset of those numbers how might I populate column D with the matching name? A match is where the names in A and D are next to the same number. For example, A, B and C are inputs and D the desired output:
____A______B_______C_______D____
1 |Larry | 11111 | 22222 | Bob |
2 |Bob | 22222 | 44444 | Steve |
3 |Mike | 33333 | 55555 | Jim |
4 |Steve | 44444 | | |
5 |Jim | 55555 | | |
Please try in D1 and copied down to suit:
=INDEX(A:A,MATCH(C1,B:B,0))
Not quite sure if this is what you are looking for, but a Vlookup function should help you greatly. I used a helper column to link C1 = A1, C2=A2 and so on. You can hide this column if you need to. You can then use the formula shown below in cell E1 and drag it down. As you put numbers in column D, the name will automatically fill in column E with the matching code.

Resources