News1 min ago
Cross Comparing Excel Files
16 Answers
I have two excel files.
In the first file there is a list of words.
In the second file there is a list of sentences.
I would like to find out how many times the word comes up in the list of sentences.
I was going to use a vlookup but that has to be exact word to word.
Does anyone know a way around this?
Thanks,
In the first file there is a list of words.
In the second file there is a list of sentences.
I would like to find out how many times the word comes up in the list of sentences.
I was going to use a vlookup but that has to be exact word to word.
Does anyone know a way around this?
Thanks,
Answers
Best Answer
No best answer has yet been selected by CoraHarrison. Once a best answer has been selected, it will be shown here.
For more on marking an answer as the "Best Answer", please visit our FAQ.You might have to work on it a bit, but how about something along the lines of one of the methods outlined in http:// office. microso ft.com/ en-gb/e xcel-he lp/coun t-how-o ften-a- value-o ccurs-H P001127 779.asp x ?
Given a copy of Access, I'd probably use that to do the job by loading both files into a database and then (sorry my SQL is very rusty) do something like select count() where B includes A - B being the table with the sentences and A being the one with the individual words. I'd use a small dataset for both A and B so that I could be sure I was getting the right numbers first though !
Given a copy of Access, I'd probably use that to do the job by loading both files into a database and then (sorry my SQL is very rusty) do something like select count() where B includes A - B being the table with the sentences and A being the one with the individual words. I'd use a small dataset for both A and B so that I could be sure I was getting the right numbers first though !
On second thoughts, I'm not sure it can be done in Excel unless each word of your sentences is in a separate cell of a spreadsheet i.e. each sentence is on a single row, with each word in a single cell on that row and no punctuation.
I'm not even sure that you could do it the way I outlined in Access either, come to that.
There is a way to do it using Excel and the word counter and text analyser at http:// sporkfo rge.com /text/w ord_cou nt.php
If you go to that page, scroll down and click on the browse button under the text entry box and select the file with your sentences in, then click on the Upload File & Analyze Text button, it will, among other things, return a list of the words in your file with a word count for each of them. You can copy that list and paste it into Notepad, then load that file into Excel along with the your individual words list, and then use Vlookup.
OK, so it's not quite as simple as that and you will, perhaps, have to do a bit of tweaking of the Notepad list, but it should work and be a lot faster than trying to find ways to do it exclusively in Excel. The only limit with the Sporkforge link is that your file containing the sentences has to be smaller than 5Mb.
I'm not even sure that you could do it the way I outlined in Access either, come to that.
There is a way to do it using Excel and the word counter and text analyser at http://
If you go to that page, scroll down and click on the browse button under the text entry box and select the file with your sentences in, then click on the Upload File & Analyze Text button, it will, among other things, return a list of the words in your file with a word count for each of them. You can copy that list and paste it into Notepad, then load that file into Excel along with the your individual words list, and then use Vlookup.
OK, so it's not quite as simple as that and you will, perhaps, have to do a bit of tweaking of the Notepad list, but it should work and be a lot faster than trying to find ways to do it exclusively in Excel. The only limit with the Sporkforge link is that your file containing the sentences has to be smaller than 5Mb.
Assume your word is in A1 and your sentence in A2.
The formula =COUNTIF (A2,"*"&A1&"*") will return 1 if the sentence contains the word, so you could use this as a starting point.
Only problem is that it will only return 1 or 0, so even if the word appears twice you will only get 1. And it looks for strings, so if your word is "and" and the sentence contains "android" it will still count as 1.
The formula =COUNTIF (A2,"*"&A1&"*") will return 1 if the sentence contains the word, so you could use this as a starting point.
Only problem is that it will only return 1 or 0, so even if the word appears twice you will only get 1. And it looks for strings, so if your word is "and" and the sentence contains "android" it will still count as 1.
But if there are 100 words to check that will take forever. And if the list of sentences or words ever changes you have to start again.
With a formula, you could check 100 words in a second. And if anything changes then it updates instantly.
And your Find All solution has the same downsides as mine regarding duplicates and words within words :-)
With a formula, you could check 100 words in a second. And if anything changes then it updates instantly.
And your Find All solution has the same downsides as mine regarding duplicates and words within words :-)
You could try the method on this page, which I have tried and it does work:
http:// support .micros oft.com /kb/187 667
http://
Related Questions
Sorry, we can't find any related questions. Try using the search bar at the top of the page to search for some keywords, or choose a topic and submit your own question.