What kind of lookup function would work for this?

anewc1

Board Regular
Joined
Sep 8, 2005
Messages
180
Excel Workbook
A
1Employee No: 56-0003051 Ovalle, Esmeralda
2-------------------------------------------------------------------------------
3 Address: 558 Comal St. Sort Field: EGP Offic
4
5 City: Eagle Pass Marital Status: M
6 State: TX ZIP CODE: 78852 Sex: F
7 Statutory Employee: N
8 Phone No: ( ) - Race Code: H
9Soc Sec No: xxx-63-7479 Pens/Prof Shr: N
10Birth Date: 05/31/70 Direct Dep: N
11 Hire Date: 03/13/01 COMMENT:
12Term/Inact: COMMENT:
13Review Date: COMMENT:
Sheet1


I have a text document that is way too long to print out, and it would be easier if I could put together the information in a spreadsheet form. When I open the document in Excel, it is all one column straight down. I want to be able to look up a social security number, then return the information in a specific row above or below it. For example, if I look up the social in the example, I want to also return the name of the employee that is a set 8 rows above it, the address that is 6 rows above the social, the city and state that are 4 rows above the social, and so on. What kind of lookup function would work for this? TIA!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
X2:

=LOOKUP(9.99999999999999E+307,SEARCH(LookupValue,Range))

Once you have the position ("row"), you can retrieve the needed info with:

INDEX(Range,SUM(X2,N))
 
Upvote 0
I'm sorry, that's a bit too vague, I don't understand. Why is the first value in the Lookup function 9.99999999999999E+307? "LookupValue" in the function would be a the SS#, and Range would be $A$1:$A$8831?

For the Index function, which range does Range refer to? When you say to put that formula in X2, is that just a random cell you picked? What does "N" refer to?

Thanks for any help.
 
Upvote 0
I'm sorry, that's a bit too vague, I don't understand. Why is the first value in the Lookup function 9.99999999999999E+307? "LookupValue" in the function would be a the SS#, and Range would be $A$1:$A$8831?

For the Index function, which range does Range refer to? When you say to put that formula in X2, is that just a random cell you picked? What does "N" refer to?

Thanks for any help.

To recap, also because my proposal wasn't complete...

I1: xxx-63-7479

I2:
Code:
=LOOKUP(9.99999999999999E+307,
   SEARCH(I1,$A$1:$A$8831),
   ROW($A$1:$A$8831)-ROW($A$1)+1)

I3:

=INDEX($A$1:$A$8831,I2-4)

I1 is SS# of interest.
I2 determines the position of I1, relative to $A$1:$A$8831.
I3 returns the text at I2-4.
 
Upvote 0
AWESOME. Thank you so much for clarifying, you just saved me a lot of time! Have a great day!
 
Upvote 0

Forum statistics

Threads
1,215,045
Messages
6,122,830
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top