Excel Tip .com / Excel Tips and Tricks
      "... the easiest to understand excel book ..."     excel : excel tips : microsoft excel : excel tutorial : excel template : excel formula : excel macro : excel help : excel password : vba excel : excel spreadsheet : excel tool : excel download : microsoft excel download : excel 2000 : excel visual basic : ms excel : excel tip : free download excel : microsoft excel tutorial : excel training : free excel template : microsoft excel help : free excel : excel password recovery : microsoft excel 97 : excel 2000 tutorial : excel 97 : excel center : excel downloads : excel recovery : excel software : excel pivot table : excel book
ExcelTip.com Home Page Tip of the Hour Recommended Microsoft Excel Tips Most Viewed Microsoft Excel Tips at ExcelTip.com Excel Tip Categories Excel Tips by Version Submit a Tip My Bookmarked Tips Discount Book Store
Over 752,108 tips served







FREE DOWNLOAD

ExcelTip.com Free Add-In

SUPPORT EXCELTIP.COM

Make your Amazon.com purchases by clicking the graphic below

Excel Tip .com - Mailing List Thread Index


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lookup Question



Thanks,

That will indeed do what I need and hopefully pointed me in the direction to
a formula driven answer. I have no problem with UDF's, but I like to to try
and use formula where ever possible for the benefit of work collegues.
        Just thinking about the method that you have used in the UDF, I
could you the SEARCH function e.g SEARCH(X,A1,1) to locate the position of
the 1st text char. Only problem is I'm not sure what Function or formula to
replace X with that will locate just text)

Regards
Graham

> -----Original Message-----
> From: Lee Fuller [mailto:Lee.Fuller@HEWITTBACONWOODROW.COM]
> Sent: 21 November 2003 13:21
> To: EXCEL-G@PEACH.EASE.LSOFT.COM
> Subject: Re: Lookup Question
>
>
> I couldn't see any way of doing using a formula. I've written this UDF
> which will do what you need, pretty naff though.  You just
> need to copy
> and paste this to a standard module then in your worksheet put
>
> =FINDTEXT(A1)
>
> It looks through the string one letter at a time, it it finds a number
> then it will move onto the next letter until it finds a
> letter, this will
> then return the next 3 letters as your code.  I've had to put
> Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" because
> VBA will only return the numbers as strings otherwise it would
> have been simpler to use Case 0 - 9.
>
> Hope this helps.
>
> Public Function FindText(Find_Text As Range) As String
>     Dim TextCheck As String
>
>     For x = 1 To Len(Find_Text.Value)
>
>         TextCheck = Mid(Find_Text.Value, x, 1)
>
>         Select Case TextCheck
>
>         Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
>           'ignore if equals any of above
>
>         Case Else
>             FindText = Mid(Find_Text.Value, x, 3)
>             Exit For
>         End Select
>
>     Next x
>
> End Function
>
>
>
>
>
>
> "Hoggins, Graham" <hoggig@RAYOVAC.CO.UK>
> Sent by: "MS Excel General Q & A List" <EXCEL-G@PEACH.EASE.LSOFT.COM>
> 21/11/2003 13:04
> Please respond to "MS Excel General Q & A List"
>
>
>         To:     EXCEL-G@PEACH.EASE.LSOFT.COM
>         cc:
>
>         Subject:        Re: Lookup Question
>
>
>
> Thanks Don,
>
> I was hoping that this would be possible to do via formula rather than
> VBA.
> it was my understanding that the FIND and SEARCH function can
> only find
> one
> string at a time and not one of many from an aray.
>
> Regards
> Graham
>
> > -----Original Message-----
> > From: Don Guillett [mailto:donaldb@281.COM]
> > Sent: 21 November 2003 12:37
> > To: EXCEL-G@PEACH.EASE.LSOFT.COM
> > Subject: Re: Lookup Question
> >
> >
> > Look in vbe help index for FIND
> >
> > Don Guillett
> > SalesAid Software
> > donaldb@281.com
> > ----- Original Message -----
> > From: "Hoggins, Graham" <hoggig@RAYOVAC.CO.UK>
> > To: <EXCEL-G@PEACH.EASE.LSOFT.COM>
> > Sent: Friday, November 21, 2003 6:18 AM
> > Subject: Lookup Question
> >
> >
> > > Afternoon/morning all,
> > >
> > > I've setup up a workbook to process a flatfile of a
> > shipping bill that we
> > > receive weekly (approx 500 lines per week)
> > > Currently I lookup up a reference code against a table of
> > country and
> > > account codes so I can split and analysis the bill. e.g
> > >
> > > Ref             Amount
> > > VGE10000        100
> > > VGE10001        100
> > > VFE10003        200
> > > VNL10003        250
> > > MAR10004        50
> > >
> > >
> > > Lookup Table
> > >
> > > Code    Department              Account
> > > VGE     Germany         10100
> > > VFE     France          10200
> > > VNL     Netherlands             10300
> > > MAR     Marketing               10400
> > > SAL     Sales                   10500
> > >
> > >
> > > The formula I currently use  is
> > "vlookup((left($A1,3)),Lookup,2,false)"
> > >
> > > This works great if distribution department adhere to the
> > convention of
> > > prefixing the reference code with the 3 digit lookup code.
> > Unfortunately
> > as
> > > this isn't a perfect world it isn't always done and I get multiple
> > > variations on the code... eg. _VGE10000, 10000VGE, 10000_VGE, and
> > 10000VGE_
> > > There are also a number codes that do not need a prefix
> > code at all and
> > > these are displayed as a plain number.
> > >         At the moment I am manually correcting these codes
> > and moving the
> > > prefix code to the front so the vookup works.
> > > Is it possible to search the reference code to see if it
> > includes one of
> > the
> > > prefix codes regardless of position. If the  lookup code is
> > found, then I
> > > can determine the starting position and use the MID(0,0,0)
> > funtion to
> > return
> > > the lookup parameter?
> > >
> > > Any help would be appreciated and I'd really like to this
> > with formula.
> > >
> > > Regards
> > > Graham
> > > ****** IMPORTANT NOTICE ****** Please note that we reserve
> > the right to
> > > monitor and read any Emails sent and received by the
> > Company under the
> > > Telecommunications (Lawful Business Practice) (Interception of
> > > Communications) Regulations 2000.
> > >
> > >
> > --------------------------------------------------------------
> > ------------
> > > The EXCEL-G list is hosted on a Windows NT(TM) machine
> > running L-Soft
> > > international's LISTSERV(R) software.  For
> subscription/signoff info
> > > and archives, see
> > http://peach.ease.lsoft.com/archives/excel-g.html .
> > >                              COPYRIGHT INFO:
> > >
> >
> http://peach.ease.lsoft.com/scripts/wa.exe?SHOWTPL=COPYRIGHT&L=EXCEL-G
> > >
> > >
> >
> > --------------------------------------------------------------
> > ------------
> > The EXCEL-G list is hosted on a Windows NT(TM) machine
> running L-Soft
> > international's LISTSERV(R) software.  For subscription/signoff info
> > and archives, see
> http://peach.ease.lsoft.com/archives/excel-g.html .
> >                              COPYRIGHT INFO:
> >
> http://peach.ease.lsoft.com/scripts/wa.exe?SHOWTPL=COPYRIGHT&L=EXCEL-G
> >
> ****** IMPORTANT NOTICE ****** Please note that we reserve
> the right to
> monitor and read any Emails sent and received by the Company under the
> Telecommunications (Lawful Business Practice) (Interception of
> Communications) Regulations 2000.
>
> --------------------------------------------------------------
> ------------
> The EXCEL-G list is hosted on a Windows NT(TM) machine running L-Soft
> international's LISTSERV(R) software.  For subscription/signoff info
> and archives, see http://peach.ease.lsoft.com/archives/excel-g.html .
>                              COPYRIGHT INFO:
> http://peach.ease.lsoft.com/scripts/wa.exe?SHOWTPL=COPYRIGHT&L=EXCEL-G
>
>
>
>
>
>
>
>
> This material has been checked by us for computer viruses and
> although none has been found by us, we cannot guarantee that
> it is completely free from such problems and we do not accept
> any liability for loss or damage which may be caused.  Please
> therefore check any attachments for viruses before using them
> on your own equipment.  If you do find a computer virus
> please inform us immediately so that we may take appropriate action.
>
> This communication is intended solely for the addressee and
> is confidential.
>
> If you are not the intended recipient, any disclosure,
> copying, distribution or any action taken or omitted to be
> taken in reliance on it, is prohibited and may be unlawful.
>
> Visit our website at http://www.hewittbaconwoodrow.co.uk (UK)
> or http://www.hewittbecketts.ie (Ireland)
>
> --------------------------------------------------------------
> ------------
> The EXCEL-G list is hosted on a Windows NT(TM) machine running L-Soft
> international's LISTSERV(R) software.  For subscription/signoff info
> and archives, see http://peach.ease.lsoft.com/archives/excel-g.html .
>                              COPYRIGHT INFO:
> http://peach.ease.lsoft.com/scripts/wa.exe?SHOWTPL=COPYRIGHT&L=EXCEL-G
>
****** IMPORTANT NOTICE ****** Please note that we reserve the right to
monitor and read any Emails sent and received by the Company under the
Telecommunications (Lawful Business Practice) (Interception of
Communications) Regulations 2000.

--------------------------------------------------------------------------
The EXCEL-G list is hosted on a Windows NT(TM) machine running L-Soft
international's LISTSERV(R) software.  For subscription/signoff info
and archives, see http://peach.ease.lsoft.com/archives/excel-g.html .
                             COPYRIGHT INFO:
http://peach.ease.lsoft.com/scripts/wa.exe?SHOWTPL=COPYRIGHT&L=EXCEL-G





Amazon.com $35.95
MrExcel.com $24.95
Barnes & Noble $28.76
And at your local bookseller





Excel Training Level I
Excel Training Level II
Excel Training Level III
Excel VBA Training Level I
Excel VBA Training Level II
View All Excel Training Programs




Formula Manager
Duplication Manager
Text Manager
Number Manager
Add-ins Collection
Spreadsheet Assistant
Number Manager
Add-ins Collection
Spreadsheet Assistant

View All Excel Add-Ins

Tips

Add-In in VBA | Applications - Word, Outlook in VBA | Array Formulas | Cells, Ranges, Rows, and Columns in VBA | Counting | Custom Functions | Custom Functions in VBA | Database Formulas | Database in VBA | Date & Time Formulas | Date & Time in VBA | Events in VBA | Excel Chart | Excel Consolidating | Excel Counting | Excel Custom Functions using VBA | Excel Customizing | Excel Data | Excel Dates | Excel Editing | Excel Files | Excel Filter | Excel Format | Excel Formula | Excel General | Excel Grouping and Outlining | Excel Importing Text Files | Excel Information | Excel Keyboard Shortcuts | Excel Loan Formulas | Excel Macros - VBA | Excel Pivot Tables | Excel Printing | Excel Range Name | Excel Security - Protection | Excel Sorting | Excel Style | Excel Subtotals | Excel Summing | Excel Text | Excel Time | Excel Tools | Excel Worksheet, Workbook | Files, Workbook, and Worksheets in VBA | Financial Formulas | Formating in VBA | General Topics in VBA | Import and Export in VBA | Information Formulas | Keyboard & Other Shortcuts in VBA | Keyboard Formula Shortcuts | Links between Worksheet and Workbooks | Links in VBA | Logical Formulas | Lookup Formulas | Mail - Send and Receive in VBA | Menus, Toolbars, Status bar in VBA | Modules, Class Modules in VBA | New Excel 11, Excel 2003 | Other Q&A Formulas | Printing in VBA | Protecting in VBA | Summing | Text Formulas | User Forms, Input boxes in VBA | Using Loops | Working with Formulas |

Tips by Version

Microsoft Excel 97 | Microsoft Excel 2000 | Microsoft Excel 2002 | All Microsoft Excel Versions | New in Excel 2002 | New in Excel 2003 - Office 11

Website

Home | Tip of Hour | Recommended Tips | Most Viewed Tips | Tips by Version | Submit a Tip | My Tips
Microsoft Excel Tutorials | Excel Links | Write for Us | About Us | Search Results | Tip Archives

Excel Book

Excel 97 Book | Excel 2000 Book | Excel 2002 Book | Excel XP Book | Book Store

Terms and Conditions of use
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.

Copyright © 2003 ExcelTip.com
Microsoft, Microsoft Excel is a U.S. registered trademark of Microsoft Corporation
Site Developed By: Irubin Consulting


excel : excel tips : microsoft excel : excel tutorial : excel template : excel formula : excel macro : excel help : excel password : vba excel : excel spreadsheet : excel tool : excel download : microsoft excel download : excel 2000 : excel visual basic : ms excel : excel tip : free download excel : microsoft excel tutorial : excel training : free excel template : microsoft excel help : free excel : excel password recovery : microsoft excel 97 : excel 2000 tutorial : excel 97 : excel center : excel downloads : excel recovery : excel software : excel pivot table : excel book