Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 516
Default Vlookup using concatenated column indexes

I'm using Excel 2003 and trying to write a vlookup formula in Sheet 1 to
lookup an array in Sheet 2: Column A (text), Column B (text), Column C
(number) and Column D (number). The text in Columns A and B appear in either
column but never both on the same row. Like wise for Columns C and D. The
array data is a dump from another program and for some reason cannot dump the
data into the one column. To combat this, I am trying to concatenate Columns
A and B and put the text into Column E. I am then trying to concatenate
Columns C and D and put the value into Column F. I then try to do a vlookup
using columns E and F as the array but the vlookup does not see the
concatenated text string.

I have searched the discussion group page for over an hour now and still
can't find anything. Can anyone help please?
--
Regards
Matt
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default Vlookup using concatenated column indexes

How are you concatenating? Are you making sure spaces are remove with TRIM?
I would be happy to look at sample data (private email)
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Matt" wrote in message
...
I'm using Excel 2003 and trying to write a vlookup formula in Sheet 1 to
lookup an array in Sheet 2: Column A (text), Column B (text), Column C
(number) and Column D (number). The text in Columns A and B appear in
either
column but never both on the same row. Like wise for Columns C and D.
The
array data is a dump from another program and for some reason cannot dump
the
data into the one column. To combat this, I am trying to concatenate
Columns
A and B and put the text into Column E. I am then trying to concatenate
Columns C and D and put the value into Column F. I then try to do a
vlookup
using columns E and F as the array but the vlookup does not see the
concatenated text string.

I have searched the discussion group page for over an hour now and still
can't find anything. Can anyone help please?
--
Regards
Matt


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 516
Default Vlookup using concatenated column indexes

Thanks Bernard. The imported data in Columns A and B (text) contained a space
at the end of each line of text.

The revised formula that I put into Cell E1 on Sheet 2 was:
=concatenate((trim(A1)),(trim(A2)))

Thank you for your assistance. Worked great.
--
Regards
Matt


"Bernard Liengme" wrote:

How are you concatenating? Are you making sure spaces are remove with TRIM?
I would be happy to look at sample data (private email)
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Matt" wrote in message
...
I'm using Excel 2003 and trying to write a vlookup formula in Sheet 1 to
lookup an array in Sheet 2: Column A (text), Column B (text), Column C
(number) and Column D (number). The text in Columns A and B appear in
either
column but never both on the same row. Like wise for Columns C and D.
The
array data is a dump from another program and for some reason cannot dump
the
data into the one column. To combat this, I am trying to concatenate
Columns
A and B and put the text into Column E. I am then trying to concatenate
Columns C and D and put the value into Column F. I then try to do a
vlookup
using columns E and F as the array but the vlookup does not see the
concatenated text string.

I have searched the discussion group page for over an hour now and still
can't find anything. Can anyone help please?
--
Regards
Matt



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Vlookup using concatenated column indexes

You could also upload your sample file/data using a free filehost, then post
a link to it here.

Eg, you could use this free filehost to upload:
http://www.freefilehosting.net/

Copy the "direct link" which is generated after you upload,
then paste it here
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,388
Default Vlookup using concatenated column indexes

Hi,
If your original data (columns A, B, C, D) is imported from somewhere else,
it may contain trailing or leading spaces, or character 160. The concatenated
data (Columns E, F) will include these. Use the TRIM function to get rid of
excess spaces, and the SUBSTITUTE function to get rid of character 160.
=TRIM(SUBSTITUTE(E1,CHAR(160)," ")) and copy down.
Regards - Dave.


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 516
Default Vlookup using concatenated column indexes

Thanks Dave. The imported data in Columns A and B (text) contained a space
at the end of each line of text.

The revised formula that I put into Cell E1 on Sheet 2 was:
=concatenate((trim(A1)),(trim(A2)))

Thank you for your assistance. Worked great.

--
Regards
Matt


"Dave" wrote:

Hi,
If your original data (columns A, B, C, D) is imported from somewhere else,
it may contain trailing or leading spaces, or character 160. The concatenated
data (Columns E, F) will include these. Use the TRIM function to get rid of
excess spaces, and the SUBSTITUTE function to get rid of character 160.
=TRIM(SUBSTITUTE(E1,CHAR(160)," ")) and copy down.
Regards - Dave.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Vlookup using concatenated column indexes

=concatenate((trim(A1)),(trim(A2)))

Think this shorter version: =TRIM(A1&" "&A2)
would work just as well for you

You can use the ampersand operator: &
to do the concatenations
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Vlookup using concatenated column indexes

Or rather, just: =TRIM(A1&A2)
since your expression doesn't concat a single space in-between
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

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
Removing concatenated colums after using them? Karen Stull Excel Worksheet Functions 3 December 23rd 09 04:24 AM
concatenated lookup? BorisS Excel Worksheet Functions 7 December 13th 06 06:57 PM
appearance of a concatenated value Jan Buckley Excel Worksheet Functions 0 November 15th 06 09:29 PM
align 3 concatenated strings for column appearnace Dano New Users to Excel 1 April 13th 06 04:38 AM
warning with concatenated date Micos3 Excel Discussion (Misc queries) 3 March 3rd 06 11:29 AM


All times are GMT +1. The time now is 05:50 AM.

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

About Us

"It's about Microsoft Excel"