Excel: VLOOKUP and FIND combinations - excel

I am not very familiar with Excel functions and I need some advice on the following problem.
I have two worksheets called List1 and List2, which help me with ordering goods for my shop.
I want to find the exact keyword in List1 column B, e.g car, "read" the corresponding value from column C, then find the same word in List2 and return the value in column C. I am open to solutions using macro, script, or excel formula.
I tried to solve it with VLOOKUP function in List2 but the data is from my supplier so it's in different order and he may change or add some new rows in it sometimes and i must always copy the function from the previous version of the file one by one and paste them to the new one. The table contains more than 3,000 items but I am only ordering something like 200.
Thanks in advance, for any help...

Try this:
=INDEX(list1.$c$2:$c$7,MATCH(list2.c2,list1.$A$1:$A$6,0))

Related

Using VLOOKUP and not only match on first value

I'm trying to use VLOOKUP to match activities with product codes, but run into an issue since VLOOKUP always returns the first match. I did a mockup below to describe my issue. To the left, I have a table with activity names and product codes.
To the right, in column G, I want to, based on matching activity names in column F with activity names in column A, assign the activities product codes from column B.
When I use VLOOKUP, it only matches with the first activity name and give all the activities with the same name the same product codes. I need them to get different product codes even if they have the same name. I want my function to "take the next one" on the list, when the first one is taken.
Should I try to use another function to solve this? Is it impossible with VLOOKUP? My 'real' document has like 2000 rows, and the solutions I found on Youtube was not good to scale.
Thanks in advance. I'm new to here so if I should clarify my question in any way, feel free to tell me.
If the raw is around 2,000 rows, you can use a nested index match with helper columns.
Add a rank in column C with the formula =COUNTIF(A2:$A$2,A2)
Then apply the same ranking in your output part as well (Ensure Activity Name is sorted so that the formula works), Output rank formula =IF(J2=J1,I1+1,1)
Formula that lists out the Product Code {=INDEX($B$2:$B$3190,MATCH(I2,IF($A$2:$A$3190=J2,$C$2:$C$3190),0))}
This is an array formula, you get the curly brackets by hitting control+shift+Enter instead of just Enter upon keying in the formula
If you are using excel 365, you can use UNIQUE formula.
=UNIQUE(A2:B18)

Excel: Categorizing cells based on a partial match

UPDATE: found an answer to my problem through this website: https://exceljet.net/formula/categorize-text-with-keywords
I'm trying to categorize certain products based on the beginning of each product name. My first table is the look-up table below:
My second table currently looks like this:
And I want the end result of that second table to look like this:
What excel formula can I use to achieve the red column? I've tried scouring the internet, for the formula that best suits my need, but I can't figure it out. I've seen people throw out the =Lookup(Search()) function, but my formula needs to start with the key word, but just contain the keyword somewhere in the cell.
I've read many different forums, but I haven't been able to find one that answers a scenario similar enough to mine. Any suggestions are appreciated.
If the first word of the Product Name is always matched to the product start, you can vlookup by just the 1st word. Assuming your product start is in column A, Categerization in Column B, Product Name in Column C, you can key in the formula in Column D:
'''
=vlookup(left(C2,search(" ",c2)-1),A:B,2,0)
'''
Just set your vlookup 4th parameter to TRUE:
Note: formula as written can be drag/filled down from B2. Also your Category Table needs to be in A-Z sorted order.
HTH

Returning highest value in a column with certain header

I nedd help with creating a formula in excel. I have two spreadsheets. In Sheet1 I have a table, names of the items in row 1, names of the parameters in column A and each pair of Item and Parameter has a value. In spreadsheet 2 I have a list of the same Items but in random order and with repetitions (Sorting is out of question as it would hurt formulas in other spreadsheets). I need a formula that for each Item in spreadsheet2 would return a name of the parameter with the highest value for that item. It looks very similar to the example on the pictures
I was thinking about using something like =INDEX(sheet1!A:A;MATCH(MAX(?);?;0);1)
But in place of question marks I would have to put the column name in the formula or find a way to pass it a reference but I don't know how.
EDIT: I know how to do it in VBA but I would prefer to do it in a formula instead
Close, use another INDEX/MATCH to return the correct column:
=INDEX(sheet1!A:A,MATCH(MAX(INDEX(sheet1!A:S,0,MATCH(A2,sheet1!$1:$1,0))),INDEX(sheet1!A:S,0,MATCH(A2,sheet1!$1:$1,0)),0))
There are tidier ways but here is an initial:
=INDEX(Sheet1!$A$1:$A$12,MATCH(MAX(INDEX(Sheet1!$A$1:$F$12, ,MATCH($A2,Sheet1!$B$1:$F$1,0)+1)),INDEX(Sheet1!$A$1:$F$12, ,MATCH($A2,Sheet1!$B$1:$F$1,0)+1),0))

Vlookup function generating duplicate values, how can I fix this please?

Hy Every Body, I have two excel sheets name as "Blotter" and "Opportunity", I want to use "Vlookup" Function in Opportunity so that I can find out which opportunity is available in the blotter sheet. Please take a look at the Blotter sheet as under
In the Column B the Opportunities are available.
Now please look at the opportunity sheet.
In the opportunity sheet I am using this function.
=IF(D2 = "","",VLOOKUP(D2,blotter,10,0))
It working fine with first five rows but later it start duplicate the same value multiple time, because behind these cell on the blotter sheet the column B has Piad/place status instead of opportunity. So it duplicate the next opportunity. I have tried many tricks like match, index, but in vain.
I know it can be fixed. I have google it and also try to find it via youtube but unable to fix it.
I don't think it can be done without an intermediate column. The position of the next value in the lookup key depends on where the position of the last successful lookup was, so in a way the lookup chain is path dependent and I don't think you can build path dependency with any ease inside an Excel formula.
In the below example you get something akin to what I think you want by calculating how many spaces there are to the next valid lookup key in Column C, and then doing an Offset in column D. In column C I use an indirect which generates path dependency based on the sum of the cells above itself. You would need to apply similar principles to your example, should only need a single equivalent of my column C.
Formulas as follows:
Column C: =MATCH("OPP",INDIRECT("A"&SUM($C$1:C1)+2&":A50"),0)
Column D: =OFFSET($B$1,SUM($C$1:C2),0)

Excel Lookup Where another Column has Value

I am attempting to create a macro in excel vba that performs the following functions. We have a list of transactions, and the same customer can have multiple transactions.
However, the Customer's ID, which is required, is not always listed. For Example, Say Column 'A' has the customer names and 'B' has the IDs. If Column 'B' is blank for a particular instance I want to find the next instance of Column 'B' under the same Customer Name that has value, and put that value into all of the Column 'B's (I could also do this line by line).
I have considered using a vlookup, but the columns are unordered and I cannot find how to add a "Vlookup where XXX".
Thanks.
I cannot embed an image yet, so here is a link to how the sheet may be formatted.
Excel
I am looking have the same numbers for each of the names in VBA.
Thanks for the help.
Use an embedded If statement. I can't give you the exact statement because you've not posted any code or what you've tried. To illustrate your situation, you would use a statement similar to:
=IF(ISBLANK(B3),C3,B3)
Then embed this into your VLOOKUP like this:
=VLOOKUP(IF(ISBLANK(B3),C3,B3),Sheet2!A1:G132,3,FALSE)

Resources