Excel database?

Started by
3 comments, last by Cestps 20 years, 7 months ago
Ok, so I want a list of persons, like this:

|Name1|Name2|IDnum|
|Egon |Quist|    1|
|Peter|Pan  |    2|
|Egon |Smith|    3|
|John |Brown|    4| 
Containing the first name, last name, and number (Or perhaps just row number) of some persons. Now I want to make a function so that I can write the name of a person and retrieve his number: |John|Brown| 4|<-- Like this, I write "John" and "Brown" and get "4". How would I go about this?
Abnormally large and solar energy charged!
Advertisement
Hmm, could do with more information as to what you''re trying to achieve here. Are you talking about writing that function in Excel as a formulae, or am I missing the point?

You could do this in Access (or any other database), then use SQL to query the database for the information you''re looking for. An example query might look something like:

"SELECT IDnum FROM persons WHERE Name1 = "John" AND Name2 = "Brown" 


You could easily write a wrapper function to do this for you, passing Name1 and Name2 as parameters to the function. Then, depending on if a record was successfully retrieved, you could either return IDnum from the function (as an unsigned integer type, long most likely) or -1 if the record wasn''t found.

Pseudocode
result = getID(Name1, Name2);if (result == -1)  // Record wasn''t found.else  // Record was found. 


Hope that helps,

--hellz
Umm, no, it has to be straight MS Excel.
Basically I have a long list of names in an Excel document, and I want to know what row any given name is on.
Ah ok, sorry I can''t help you there then. Been too long since I''ve used Excel. :|

I did find this though, http://www.hotscripts.com/Detailed/23919.html, so maybe you can rip an idea from that?

Either way, good luck with it.

--hellz
VLOOKUP

Niko Suni

This topic is closed to new replies.

Advertisement