Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Excel string lookup

Thread Tools
 
Search this Thread
 
Old 09 March 2006, 01:51 PM
  #1  
john banks
Scooby Regular
Thread Starter
 
john banks's Avatar
 
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like on 1 Post
Question Excel string lookup

BNF Chapter
Group
1
Gut
2
Circulation
3
Breathing
4
Nervous system
5
Infection
6
Hormones
7
Obstetrics, Gynaecology or Urinary systems
8
Immune system
9
Nutrition or blood
10
Bones
11
Eye
12
Ear, nose, throat
13
Skin
14
Vaccines
15
Anaesthetics


I have the above table with the number in column A and the string in column B.

I want a function that does a lookup from another cell which contains a number that matches one of those in column A and will return the string in column B, but the Excel functions I can find appear to be numberical.

Hints welcomed!

Last edited by john banks; 09 March 2006 at 01:53 PM.
Old 09 March 2006, 02:04 PM
  #2  
Hanslow
Scooby Regular
 
Hanslow's Avatar
 
Join Date: Mar 2001
Location: Derbyshire
Posts: 4,496
Likes: 0
Received 0 Likes on 0 Posts
Default

John, this of any help?
Old 09 March 2006, 02:17 PM
  #3  
bob269
Scooby Regular
 
bob269's Avatar
 
Join Date: Mar 2003
Posts: 2,654
Likes: 0
Received 1 Like on 1 Post
Default

Formula would be =VLOOKUP(H5,A1:B18,2)

where H5 is the cell where your cross reference number is,

A1:B18 would be your data range

and the ,2 indicates the resulting field should display column 2 from the datarange, which would be the reference/description.

Hope this helps.

Old 09 March 2006, 02:48 PM
  #4  
john banks
Scooby Regular
Thread Starter
 
john banks's Avatar
 
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like on 1 Post
Default

Works great thanks!
Old 09 March 2006, 03:48 PM
  #5  
john banks
Scooby Regular
Thread Starter
 
john banks's Avatar
 
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like on 1 Post
Default

Further two questions if I may!

1. When you copy of function down a column it automagically moves the references to other cells as it copies down, how do I stop this if I want the whole column to refer to one cell or array? Can I define an array with a name and reference to that?

2. Can I automatically link a text file to be imported into a cell range when the spreadsheet is opened? The text file is imported with fixed width columns each time.
Old 09 March 2006, 03:53 PM
  #6  
bob269
Scooby Regular
 
bob269's Avatar
 
Join Date: Mar 2003
Posts: 2,654
Likes: 0
Received 1 Like on 1 Post
Default

Using my above example =VLOOKUP($H$5,$A$1:$B$18,2)

putting the $ infront of the Cells, locks it when you copy it.

Point 2. Is possible via the on open macro. Needs a little thinking about.


You may want to add the false command to the end, currently if you enter anything above 15 in your check cell it will always report back with Anaesthetics, adding false forces it to return an error if the number does not exist.

=VLOOKUP($H$5,$A$1:$B$18,2,False)

Last edited by bob269; 09 March 2006 at 03:59 PM.
Old 09 March 2006, 04:04 PM
  #7  
john banks
Scooby Regular
Thread Starter
 
john banks's Avatar
 
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like on 1 Post
Default

Thanks!
Old 09 March 2006, 05:06 PM
  #8  
bob269
Scooby Regular
 
bob269's Avatar
 
Join Date: Mar 2003
Posts: 2,654
Likes: 0
Received 1 Like on 1 Post
Default

2. Can I automatically link a text file to be imported into a cell range when the spreadsheet is opened? The text file is imported with fixed width columns each time.
Easiest way would be to (while spreadsheet is open) go to data menu->import external data->import data,

then use the wizard to select your text file, widths etc.

On the last page when it asks you where you want to put the data, click properties and Tick Refresh Data On File Open, and remove the prompt for Filename On Refresh Tick

Last edited by bob269; 09 March 2006 at 06:24 PM.
Old 09 March 2006, 07:01 PM
  #9  
john banks
Scooby Regular
Thread Starter
 
john banks's Avatar
 
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like on 1 Post
Default

Thanks.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Mattybr5@MB Developments
Full Cars Breaking For Spares
28
28 December 2015 11:07 PM
Mattybr5@MB Developments
Full Cars Breaking For Spares
12
18 November 2015 07:03 AM
leg200
Subaru Parts
5
07 October 2015 07:31 AM
has-scooby
Subaru Parts
4
06 October 2015 03:47 PM
bluebullet29
General Technical
9
05 October 2015 02:17 PM



Quick Reply: Excel string lookup



All times are GMT +1. The time now is 04:57 PM.