Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 86
Default Inex and Lookup searches

Using MS Office Professional 2003
Given:
Four columns (A-D) titled ID, Name, Job, Job Description
Data range is A2:D158
Data is sorted alphabetically by last name:

ID Name Job Job Description
502733 Baker,Mark DIR VP MFG
502160 Jones,Debra DIR VP Finance
501565 Michaels,Susan DIR VP MKTG
504729 Smith,David DIR VP Technology

I have four names on the same sheet that already appear on the list. They
are listed from A:164:A167 in random alphabetical order by last name.

I want to search the data range referenced above and populate the ID number
in column B and Job Description in column C for my individuals names.

Formula for ID: =INDEX(A2:A158,MATCH(A164,$B$2:$B$158,TRUE),1)
Formula for Job Description: =LOOKUP(A164,$B$2:$D$158)

Problem: The formulas work for cells A164 and A165. Cells A166 and A167
return the ID number and Job Description listed for the individual appearing
one row before my individual in the data range. In other words, my
individuals information is listed in row 38 and the formula is returning the
information for row 37.

I dont understand why this is happening or how to resolve it. Help is much
appreciated!

Cynthia

--
Cynthia
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,358
Default Inex and Lookup searches

With the data not in alphabetical order, and since you are not using exact
matches, excel will search down until it finds an approximate value and then
go by that data.

To fix, I believe all you need to do is change the TRUE in your match
statement for ID to a 0 (which will then look for an exact match. 1, 0, and
-1 are the choices here).
In addition, instead of a LOOKUP for your Job Descriptino, you would want a
VLOOKUP:
=VLOOKUP(A164,$B$2:$D$158,3,FALSE)
--
** John C **
Please remember if your question is answered, to mark it answered :). It
helps everyone.


"Cynthia" wrote:

Using MS Office Professional 2003
Given:
Four columns (A-D) titled ID, Name, Job, Job Description
Data range is A2:D158
Data is sorted alphabetically by last name:

ID Name Job Job Description
502733 Baker,Mark DIR VP MFG
502160 Jones,Debra DIR VP Finance
501565 Michaels,Susan DIR VP MKTG
504729 Smith,David DIR VP Technology

I have four names on the same sheet that already appear on the list. They
are listed from A:164:A167 in random alphabetical order by last name.

I want to search the data range referenced above and populate the ID number
in column B and Job Description in column C for my individuals names.

Formula for ID: =INDEX(A2:A158,MATCH(A164,$B$2:$B$158,TRUE),1)
Formula for Job Description: =LOOKUP(A164,$B$2:$D$158)

Problem: The formulas work for cells A164 and A165. Cells A166 and A167
return the ID number and Job Description listed for the individual appearing
one row before my individual in the data range. In other words, my
individuals information is listed in row 38 and the formula is returning the
information for row 37.

I dont understand why this is happening or how to resolve it. Help is much
appreciated!

Cynthia

--
Cynthia

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
searches in Excel Gregory Albertson Excel Discussion (Misc queries) 0 September 9th 08 05:32 PM
Pulldown that searches? gilligan5000 Excel Discussion (Misc queries) 1 June 7th 07 02:53 PM
Getting valid web searches and avoiding sites that contaminate web searches David McRitchie New Users to Excel 1 June 13th 06 03:00 AM
Workbook searches jimijam Excel Worksheet Functions 0 February 17th 06 04:02 PM
Searches peterrump Excel Worksheet Functions 4 May 23rd 05 09:02 PM


All times are GMT +1. The time now is 10:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"