Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default How to get an Excel function to recognise text

Hi,

Using worksheet named "Sheet1", to convert text which looks like this -
"1001001 Sundry Expenses" into this "1001001" I'm using the following
formula:
=IF(B17="","",(IF(TYPE(VALUE(LEFT(TRIM(B17),1)))=1 ,LEFT(TRIM(B17),FIND("
",TRIM(B17),1)),TRIM(B17))))

The original text is in Cell Bx and the result is in Ax

In other worksheets I'm using Vlookups against the contents of column A
to return the relevant columnar results.

My problem is in the Vlookup formula if I enter something like
=Vlookup("1001001",Sheet1!$A$Z,16,0) I get an #N/A. It seems I need to
use the above trim formula on the sheet I'm performing the VLookup then
use a Cell reference in order for the result to be returned i.e. Place
the full account code and Desc (e.g. 1001001 Sundry Expences) somewhen
in the new worksheet then use the formula mentioned above to trim this
down to 1001001 then use the cell reference of the result in the
VLookup (=Vlookup(C22,Sheet1!$A$Z,16,0)).

How can I get Excel VLookup to recognise when I manually input a number
(like "1001001") and to return the result if this number appears in Row
A.

Any help appreciated

...pc

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How to get an Excel function to recognise text

If you try to match text against real numbers, you'll never get a match.

And =Left() and =trim() all return text strings.

If you need to match on numbers, maybe something like:

=vlookup(--(LEFT(A1,FIND(" ",A1,1)-1)), ....

The right minus sign (in --(left(...)) coerces the text "1234" to -1234 and the
left minus converts it back to a positive number.

PMC1 wrote:

Hi,

Using worksheet named "Sheet1", to convert text which looks like this -
"1001001 Sundry Expenses" into this "1001001" I'm using the following
formula:
=IF(B17="","",(IF(TYPE(VALUE(LEFT(TRIM(B17),1)))=1 ,LEFT(TRIM(B17),FIND("
",TRIM(B17),1)),TRIM(B17))))

The original text is in Cell Bx and the result is in Ax

In other worksheets I'm using Vlookups against the contents of column A
to return the relevant columnar results.

My problem is in the Vlookup formula if I enter something like
=Vlookup("1001001",Sheet1!$A$Z,16,0) I get an #N/A. It seems I need to
use the above trim formula on the sheet I'm performing the VLookup then
use a Cell reference in order for the result to be returned i.e. Place
the full account code and Desc (e.g. 1001001 Sundry Expences) somewhen
in the new worksheet then use the formula mentioned above to trim this
down to 1001001 then use the cell reference of the result in the
VLookup (=Vlookup(C22,Sheet1!$A$Z,16,0)).

How can I get Excel VLookup to recognise when I manually input a number
(like "1001001") and to return the result if this number appears in Row
A.

Any help appreciated

..pc


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2000 versus 2003 and the TEXT Function Art H Excel Worksheet Functions 2 November 10th 06 08:43 PM
Can an Excel logic function change the color of a cell or text? Mazz Excel Worksheet Functions 1 October 7th 06 10:19 PM
numerical integration integreat Excel Discussion (Misc queries) 4 May 12th 06 02:40 AM
Formulas dealing with text data Bagia Excel Worksheet Functions 6 June 20th 05 10:29 PM
in excel how to display results of a function and text in the sam. ez123 Excel Worksheet Functions 3 November 19th 04 01:16 PM


All times are GMT +1. The time now is 07:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"