I need a Formula for a Database

J

JonWardellBuilders

Here is what i need.

I have a list of of one hundred (or More) 4 digit tracking codes that have a
label (description) for each; for example 0234 is Hauling, 0142 is General
Labor etc. I think what i want is a Database so when i input my 4 digit
tracking code into cell 'A1', cell 'B1' will fill in the correct description
and i won't have to type it anymore.

I am guessing that i create a 'worksheet1' that has all the 4 digit tracking
codes in Column 'A' and all their descriptions in Column 'B'

On 'worksheet2' i would need a formula in the cells for Column 'B' that
basically says (i think) - If 'Worksheet1' cell in column 'A' equals the
tracking code entered in 'Worksheet2' cell 'A1' then insert 'worksheet1's
appropriate Column 'B' description into 'Worksheet1' cell 'B1'.

Please Help me!!!
 
M

Mike H

Hi,

That's exactly what you do, build a table out of the way along the lines of
Col G Col H
1234 Some Text
5678 More text


then when you enter your number in (say(a1) in an adjacent cell
=IF(A1<>"",VLOOKUP(A1,Sheet1!A1:B34,2,FALSE),"")
Mike
 
G

Gord Dibben

You could use the VLOOKUP function.

You would have a 2 column table with tracking codes and descriptions on another
sheet in A1:B100

In Sheet1 B1 enter this formula

=VLOOKUP(A1,Sheet2!$A$1:$B$100,2,FALSE)

Enter a tracking code in A1 of Sheet1

You could also use a Data Validation drop-down list in Sheet1 A1 for selecting
the tracking code.

Visit Debra Dalgleish's site for info on VLOOKUP function to pull data based on
value. Note the downloadable sample workbooks.

http://www.contextures.on.ca/xlFunctions02.html

Also see Debra's site for info on Data Validation selection lists for inputting
the data if need be.

http://www.contextures.on.ca/xlDataVal01.html


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top