Matching Columns in Excel: different files - excel

I have two excel files, One with product ID and description in English. Other one with the same ID and Description, but in French, but the IDs are not in same order in both files, they are listed randomly but both have the same IDs. (there are over 10000 products in the list.)
I want a formula such that I can find all the products by it's ID, Match ID with the IDs in the second file (the French one) and paste all the French description right beside English description column.
How can I make this process faster, I would have done it manually but there are 10,000 items in the list so it would take a lot of time for me.

You can Use Index- Match
Where your ID is in Column A and Description is in Column B
=INDEX([Book2.xlsx]Sheet1!$B:$B,MATCH(A1,[Book2.xlsx]Sheet1!$A:$A,0),1)
Or you could use Vlookup IF only two Columns involve
=Vlookup(A1,[Book2.xlsx]Sheet1!$A:$B,2,0)

Related

Lookup several keywords in a column, if found, return 4 columns

I've got two databases, one with 11,000 entries, and another that I've narrowed down to around 600. They are databases with Company name, and contact information for people at that company. So column A - Company Name. Column B - last name, column C - first name, column D - position, and column E - email address. What I'd like to do is search column D - position for several keywords - vice, benefit, resource, and if found, return the four columns - last name, first name, position and email address. So for company name X, we might have 10 contact names, and a couple may have contact info for people that fall into those keywords. I'd like to return those specific people.
I've managed to get the formatting between the company names normalized between the two lists, using brute force, and some index matching formulas (that was fun!), so those are the same, and I could probably do something like add 5 or 6 rows after each unique company name to accommodate the potential number of contacts we might have for each company, but I have no idea how to return multiple specific cells for a keyword search.
I think something like this might work -
=index(columntoreturn, small(if(isnumber(search(keywords, columntosearch)), match(row(column), row(column))), rows(array)))
But that will only return an individual cell, rather than the four I would need.
Here's an example of the two databases I'm working with.
as you asked the same have been closed as answered thorugh comment behalf of #Scott Craner
Answer
As I stated in my first comment, Advanced Filter is designed for this. You can put code to automatically do it based on certain cells on the page changing values. A formula is not ideal in that it would require it to be an array formula and the more array formulas and the larger the dataset would bog down the calc times. See here for an example on how to set up advanced filter using vba.

Relabelling large amounts of data in Excel

In a CSV file: I want to relabel 433,000+ rows of IDs that look like "e904ab64a642efcd25f4a43cb729701646d4bf7a4ed0bacbae9d85127978606a" into simpler ID codes. For each of these unique IDs there are 4-5 rows of data. I really don't want to "find and replace" each of them because there are over 2000+ unique IDs. Is there any function in excel that can help me do that? Otherwise, any recommendations of what programs I can use?
If the IDs are always on consecutive lines, you can
Store the ID before replacement
replace it with your simpler ID (also store it)
go to next line
check if the ID is the same as stored on the previous line
If yes, use the same replacement ID as on previous line
If no, do same 1)
If you are happy doing this manually (since your tags do not currently include vba) then here is a simple approach:
Create a Unique List of IDs, for example by creating a 1-column
PivotTable
Next to each Unique ID, put your simplified ID (however you are creating that - is there an algorithm, or could it just be =Row()?)
Insert a column in the original sheet, adjacent to the ID column
Use a VLOOKUP to find the matching Simplified ID (e.g. =VLOOKUP(A1,'New IDs'!$A:$B,2,FALSE))
When it has finished calculating, copy the Simplified IDs, and Paste Special as Values

How to extract the text from a string - Excel

I have about 670k products I need to categorise before uploading. Obviously this is too many to do manually.
So if say column C is Product Title, and in Row 3 one of the words (there will be 10-12 words and they will be in different orders) is 'Example' then I want in say column F (product category) it to have 'Example'.
Is there a way to do this? I've been looking and so far can only find numerical examples, and when I've tried they don't work with words. I assume, if it can be done, I'll have to copy down a full column of a formula but that's fine as I can delete it when done.
If there's any identifier which separates the Product Category and the remaining digits like "-", you can use the following formula in Column F,
=LEFT(C2,SEARCH("-",C2)-1)
If there's no separator, and if there's a constant number of digits after Category, say '5' then use
=LEFT(C2,LEN(C2)-5)
If not both, mention some of the data(sample) to help you more.

How to retrieve a matched substring where a string matches a list of potential substrings

Long-time user of Stack Overflow though couldn't find a clear answer to this
OBJECTIVE: Next to each Product field I need to find and retrieve a matching Brand which substring is in another worksheet.
-Worksheet 1 (Products) I have a single column with 76,000 rows
-Worksheet 2 (Brands) I have a single column with 2,000 brands and growing
Sample Data:
Products
COLUMN A
ANGEL BRAND BLACK OLIVES 2KG
ANMOL SALT TABLE 750GR
76,000 others
Brands
COLUMN A
ANTONELLI
AH
AHG
So the result should fetch a brand from a growing list and dynamically place it in the Products Worksheet:
A1- PRODUCT B1- BRAND
A2- ANGEL BRAND BLACK OLIVES 2KG B2- ANGEL
C2- ANMOL SALT TABLE 750GR C3- ANMOL
I have searched a number of forums and am convinced that the INDEX MATCH Array is what I need to do, though can't seem to get the syntax... it might be that I need to include a SEARCH in there somewhere.
This was the closest thing I found to what I need though couldn't exactly make it work for me: How to find if substring exists in a list of strings (and return full value in list if so)
Thank you for your patience in my explanation... I'll get better at this!
UPDATE: This kinda does what I am after though it takes quite a while to refresh and it's only picking up the first couple of letters as opposed to the entire word:
=IFERROR(INDEX(BRANDS!A:A,MATCH(TRUE,INDEX(ISNUMBER(SEARCH(BRANDS!A:A,A2)),,),0)),"No Match Found")
If the brand name is always included in the Products then, you can try:
=INDEX(Brands!$A:$A,MATCH(1,IF(ISERROR(SEARCH(Brands!$A:$A,A2)),0,1),0))
You enter this formula on B2 using Ctrl+Shift+Enter.
So for example, you have below set-up:
It will give you what you want. Take note though that re-calculation may take a while since you are dealing with a lot of data.
Another option would be to do this using macro which you'll need to run every time you open the workbook.
IMPORTANT: This will fail though if you have brand names like BLACK or OLIVES which is also found on the product name.

Can I get relational data into an Excel Pivot Table

I have a sheet (let's go with wines as an example) that lists every bottle of wine in my cellar, when I bought it, how much I paid etc.
There's a column that describes the wine in comma-separated tags such as "Fruity, White".
I've created a pivot table from that data, with the description as a filter column. However I can't filter it by "White". I have to find every description that contains "White" such as "Dry, White", "White, Crisp" etc.
Being from an RDBMS background, my natural inclination is to put the tags in their own table keyed against the wine row so there's zero-or-more tag rows per wine row.
How, how on earth can I use that to filter the wine rows?
Yes you can do it within Excel and the description fields can remain as "Dry, White" etc as you do not need to split the comma separated values.
Lets say the Table source comprises a text column for Description, a number column for Value and a number column for Year Bought.
Your pivot is setup with the the following
Fields: Description, Value and Year Bought.
Column labels: Year Bought
Row Labels: Description
Sum of values: Sum of Value
There is a drop down label filter on the row labels - click on this and there should be an option to select Label Filters. Select this and then select Contains. You can enter say "White" which will select all your descriptions that contain white e.g. "Dry, White", "White, Crisp". The filter includes ? to represent a single character and * to represent any series of characters.
There are similar label filters for "begins with" and "ends with" as well as there negation.
I tried this in Excel 2007 and it should also work in 2003. I think in Excel 2003 you could even combine the filters e.g. contains "White" and does not contain "Dry" but in 2007 I could not find a way of doing this.
Forgive me if I'm stating the obvious, but the reason you're having problems here is that the description column is not in 1NF, and the Excel pivot interface isn't flexible enough to allow pattern-based searching.
The simplest option will be to normalise the CSV into a series of columns, each of which represents a single attribute - one column for wine colour, one for sweetness, one for country of origin and so on - and apply the filter across multiple columns. However, if (as your comment on the question suggests) wine is a metaphor for your real problem, you may not have the luxury of revisiting the design of the source data.
Another possibility might be to use a macro (or a database query - I'm not clear from your question whether you have implemented the tag system already) to pre-filter the input data on the pivot table's source sheet based on the tag values you want to search for, then re-refresh the pivot table based on that data.
A third possibility is the VBA used in this question, which looks like it will custom-filter the pivot table's visible rows.
=IF(ISERR(FIND("WHITE",UPPER(B5))),0,1)
create an extra column and add a formula. There are 2 tricks to this. One is to search for WHITE in the description column using upper - to beat the fact that excel find is case sensitive. Two is that it returns a value error if the string does not exist - so iserr will allow you to trap that and return in this example 0 if it doesn't or 1 if it does. You could substitute white and blank for 1 and 0.
you could write a script that loops through the data and adds new lines for each comma separated item in the description column. This would allow the pivot table to filter better.

Resources