Solved

Approximate search in text data (Excel VBA, Excel SQL)

Posted on 2013-01-27
8
774 Views
Last Modified: 2013-01-28
Hello, dear members and experts!

There are good (efficient) solutions for Approximate text seach in data (for Excel VBA, Excel with SQL-queries)?

The main task is: finding from external database (Excel's file) data corresponding to data in specified collumn in main Excel's sheet.

Second task: include approximate search into custom made improved_VLOOKUP function –http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_28009228.html

Thanks in advance!
0
Comment
Question by:Last_Free_Man
  • 3
  • 3
  • 2
8 Comments
 
LVL 26

Expert Comment

by:redmondb
ID: 38824075
Last_Free_Man,

Could you be more specific about what approximate search means to you, please? Links to existing good solutions would be good!

Thanks,
Brian.
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 38824198
Agreed with Brian: we need clarification on what an approximate match is.

Taking my approach from the last question, suppose you need "the Order Number for the 7th item from the top where the Manager's name starts with 'J'."

In that case, you could use this array formula:

{=INDEX($C$1:$C$21,SMALL(IF(LEFT($A$1:$A$21,1)="J",ROW($A$1:$A$21),""),7),1)}
0
 

Author Comment

by:Last_Free_Man
ID: 38824729
I will try to explain my programmer's tasks.

I have two tables.

Table_A (XLSX file) containts column with projects names (text string with length equal 255 characters).
This data based on users input. Because of human factor projects names often have inaccuracy: double spaces, lack of spaces, mixed caps and small letters, lack of pointings and etc.

Table_B (XLSX file) containts column with project names too. But this field can have length more as 255 characters (and sometimes with NewLine symbols). Usually data in this column is more accurate than in Table_B but this is also result of users input and edit.

The task is find data in Table_B correspond to data in Table_A (with approximated search)

I need in solution based on VBA (as part of many checking and fixing subprograms).
SQL-queries (with ADO connection) are also good tool (I use it now in this current checking project).

The main plan is: use RegExp for throw off any characters in string except numbers and letters and then compare string with simplification.

Do you have any different ideas? - Good!

P.S. I have good programmers background: Perl, MySql, a little bit of JavaScript. But VBA and ADO is new languages and technologies for me. (Sorry! I'm newbe in English too!)
Help me please!
0
 
LVL 26

Expert Comment

by:redmondb
ID: 38824746
Thanks,  Last_Free_Man.

You've got matthewspatrick involved and as he is exactly the right expert for this, I'm going to quietly leave!

Regards,
Brian.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 38825168
Sample file(s) would be helpful :)
0
 

Author Comment

by:Last_Free_Man
ID: 38828114
Example attached.

It contains cyrillic symbols.
If you can't read then please write here and I will make transliteration.

Thanks in advance!
2013-01-28-Example-for-EE.xlsm
0
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 500 total points
ID: 38828564
I'm usually game for RegExp work; indeed, I wrote one of the definitive articles on using RegExp with Excel: http://www.experts-exchange.com/Programming/Languages/Visual_Basic/A_1336-Using-Regular-Expressions-in-Visual-Basic-for-Applications-and-Visual-Basic-6.html

However, doing that with cyrillic characters is going to be over my head.

I think you should use Request Attention to ask the Mods to add more zones (Regular Expressions, Perl, and JavaScript make sense), and send out alerts for Designated Experts.

Patrick
0
 

Author Comment

by:Last_Free_Man
ID: 38829924
Dear Patrick!

Yours arcticle is brilliant!

Thank you very much!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now