Excel string lookup
#1
Scooby Regular
Thread Starter
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like
on
1 Post
Excel string lookup
BNF Chapter
Group
Gut
Circulation
Breathing
Nervous system
Infection
Hormones
Obstetrics, Gynaecology or Urinary systems
Immune system
Nutrition or blood
Bones
Eye
Ear, nose, throat
Skin
Vaccines
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!
Group
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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.
#3
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.
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.
#5
Scooby Regular
Thread Starter
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like
on
1 Post
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.
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.
#6
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)
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.
Trending Topics
#8
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.
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.
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
bluebullet29
General Technical
9
05 October 2015 02:17 PM