Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Wink Search all instances of word and retrieve column data

I have an excel sheet where I have a list of 377 names (each with a group number and a letter given to each name), and am trying to search for all instances of a first name OR last name, and retrieve the row data along with the name.

Columns A1:D1 a
A1: Last Name
B1: First Name
C1: Group Number
D1: Letter

The user will input (into a "search field") a first name, last name OR both first and last and push the results to a table.

I have the following code which works fine if I only search for a "Last Name" and displays all row data:

=IF(ISERROR((INDEX($A$2:$D$377,SMALL(IF($G$2=$A$2: $A$377,ROW($A$2:$A$377)-MIN(ROW($A$2:$A$377))+1,""),ROW(A1)),COLUMN(A1)))) ,"",INDEX($A$2:$D$377,SMALL(IF($G$2=$A$2:$A$377,RO W($A$2:$A$377)-MIN(ROW($A$2:$A$377))+1,""),ROW(A1)),COLUMN(A1)))

I am not sure if I can build off of this, or use a different set of functions. I have attached an example. Thank you in advanced.
Attached Images
 
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,522
Default Search all instances of word and retrieve column data

On Monday, March 19, 2012 1:34:49 PM UTC-5, bwilliams1188 wrote:
I have an excel sheet where I have a list of 377 names (each with a
group number and a letter given to each name), and am trying to search
for all instances of a first name OR last name, and retrieve the row
data along with the name.

Columns A1:D1 a
A1: Last Name
B1: First Name
C1: Group Number
D1: Letter

The user will input (into a "search field") a first name, last name OR
both first and last and push the results to a table.

I have the following code which works fine if I only search for a "Last
Name" and displays all row data:

=IF(ISERROR((INDEX($A$2:$D$377,SMALL(IF($G$2=$A$2: $A$377,ROW($A$2:$A$377)-MIN(ROW($A$2:$A$377))+1,""),ROW(A1)),COLUMN(A1)))) ,"",INDEX($A$2:$D$377,SMALL(IF($G$2=$A$2:$A$377,RO W($A$2:$A$377)-MIN(ROW($A$2:$A$377))+1,""),ROW(A1)),COLUMN(A1)))

I am not sure if I can build off of this, or use a different set of
functions. I have attached an example. Thank you in advanced.


+-------------------------------------------------------------------+
|Filename: example.jpg |
|Download: http://www.excelbanter.com/attachment.php?attachmentid=309|
+-------------------------------------------------------------------+



--
bwilliams1188


I would use a macro using FIND to locate the last name and then see if the first name agrees with the last name. If so, do whatever.
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
How do I retrieve data based on multiple search criteria? ezaz123 Excel Worksheet Functions 1 January 20th 09 05:49 PM
How do I retrieve data based on multiple search criteria? ezaz123 Excel Worksheet Functions 0 January 20th 09 04:56 AM
Retrieve Data from Word Art data Simple_Solver Excel Discussion (Misc queries) 1 March 15th 07 12:34 PM
need formula to search column for a word and return another word Skyline Excel Discussion (Misc queries) 5 November 18th 05 10:00 PM
Replacing instances in word with data from exel Jere[_2_] Excel Programming 0 May 7th 04 12:31 PM


All times are GMT +1. The time now is 10:21 AM.

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"