Google Answers Logo
View Question
 
Q: Setting up Micosoft Excel to allow me to "match records". ( Answered,   2 Comments )
Question  
Subject: Setting up Micosoft Excel to allow me to "match records".
Category: Computers > Software
Asked by: jharmke-ga
List Price: $40.00
Posted: 02 Feb 2004 10:37 PST
Expires: 03 Mar 2004 10:37 PST
Question ID: 302822
I would like somebody to set up a script or something that will allow
me to match records in microsoft excel. As it is now, I can only use
the find feature (which finds records one by one), which is not
comprehensive enough for me. What I need is to be able to find ALL
RECORDS that contain the search variable I am looking for. For
example, if I search for "1234", I would like all cels that contain
"1234" to appear (even if the cel is "CT1234", "G1234GG", etc.). I am
using a macinotsh and Microsoft Excel X on Mac OS 10.2.6.

Request for Question Clarification by maniac-ga on 02 Feb 2004 19:29 PST
Hello Jharmke,

If you are somewhat familiar with data filtering, I can walk you
through an example where you have data like this:

Title
Hello
1234
ct1234
ak1234gg
mystery
1234kkk
[there can be columns to the left / right as well]

and then display just the lines containing 1234 or in this case
Title
ct1234
ak1234gg
1234kkk

You will be able to view the subset data (or display all or a
different subset) as well as copy / paste the visible data into
another sheet or another application. Note the number 1234 is not
selected above; the filter can be adjusted to include the number as
well as the string if needed.

I have done my testing using Microsoft Excel X on Mac OS 10.2.8, but
should run on your system as well. If this is acceptable, please let
me know so I can prepare a proper answer. If it does not hit the mark,
please explain your situation a little more fully so I can correct the
answer.

  --Maniac

Clarification of Question by jharmke-ga on 03 Feb 2004 08:56 PST
Maniac, I will explain better. I have thousnads of service manuals in
a database. If I want to find all manuals that contain 1234, I would
like the ability to bring up a search box, enter "1234", then click
search. At this point, I would like Microsoft Excel to come back with
all the models that contain "1234". If you look at MICROSOFT WORKS for
mac, it is the same as the "MATCH RECORDS" function.
Does this clears things up? can you do this?

Request for Question Clarification by maniac-ga on 03 Feb 2004 18:06 PST
Hello Jharmke,

Can I assume you already have a method to get the data out of the
database and into a sheet or do you need a method for that as well? I
have an answer based on the data already being in a sheet, say
starting at the fourth row. I can add the database extraction if
needed. Please advise.

  --Maniac

Clarification of Question by jharmke-ga on 04 Feb 2004 06:56 PST
I am not sure if you fully understand what I need (or maybe I am not
understanding the terminology). If I want to find 1234 in excel the
way it is now, I have to FIND "1234" and then keep pressing FIND NEXT.
What I want to do is to have the SEARCH/FIND function show me all cels
that have "1234" and show them to me. I sell service manuals and when
a customer calls and gives a model number, I want to search our
records and find all records that conatin his model number (i.e. 1234,
HL4562N", etc. Microsoft works has a MATCH RECORDS feature that will
give me all the records that have the variable I am looking for. I do
not need to extract anything or change the actual file, I just want
all cels that have my match critera to show when I search for them.
Please advise if this makes things clearer?

Request for Question Clarification by maniac-ga on 04 Feb 2004 10:02 PST
Hello Jharmke,

Yes - what you describe is the kind of problem my answer will handle.
I was somewhat concerned when you kept referring to a "database".
There are some users who extract the information from a database to
import into Excel and from your last clarification, it appears you
don't do that.

If the data is already in Excel, the answer I provide give you a few
different methods to view the service manuals you are looking for.
That way, you can pick the method that works best for you. I'm away
from the machine with my answer right now, but will post it in about
5-6 hours.

  --Maniac

PS: One of the solutions is as eric_2200 describes. I find that method
to be a little more difficult to set up and the alternatives I have
put together for you will be a little easier to set up (in one case)
or more like what you are used to (in the other).

Clarification of Question by jharmke-ga on 04 Feb 2004 11:37 PST
Yes, the data is in the excel spreadhseet.
Thanks,
Jim
Answer  
Subject: Re: Setting up Micosoft Excel to allow me to "match records".
Answered By: maniac-ga on 04 Feb 2004 15:24 PST
 
Hello Jharmke,

OK. I will provide a few different methods, including one that uses a
dialog box so you can have an interface similar to that used in
Microsoft Works for Macintosh.

In these examples, I assume the data has the following characteristics:
 - the first row of information has a title describing the field in
the column below it
 - each row is a record of information
 - the information is bounded by at least one blank row and column
You can check the range of cells affected by these solutions by doing
the following steps:
 - Select a cell within your data (any will do)
 - Select the Edit -> Goto menu item, a dialog box will appear
 - Select Special..., another dialog will appear with a set of selections
 - Select Current Region, then OK.
The top left cell will be selected and a light blue highlight should
appear over all your data.

[1] Autofilter

This is perhaps the most simple method to set up and is quite
powerful. To set it up:
 a. Select a cell within your data.
 b. Select the Data -> Filter -> Autofilter menu item
At this point, the right side of each header cell will have a little
box with up / down arrows in it.
 c. Click on one of those boxes and a menu will pop up giving you a
number of options; select Custom Filter..., a dialog box will appear.
It should say something like "Show rows where: (name of field)" at the
top and have a pair of menu selections and fields. The default type of
criteria is equals and the value is blank. Based on what you are
looking for:
 d. Using the menu selection, change the criteria to contains and
enter 1234 as the value. Select OK.
At this point Excel should display only the rows where 1234 is part of
the field selected.

You can filter on more than one field by applying more than one custom
filter. This also allows ranges of values. For example, you could have
  Title contains 1234
  Price greater than or equal to 100 AND less than or equal to 200
which will display rows meeting both criteria.

You can do the first two steps (a and b) once, and then as you get
each phone call do the last two steps (c and d) for the searching you
need to do.

[2] Advanced Filters

There are some combinations that cannot be done with autofilter. For
example, if you want to select records based on three different names,
then Autofilter won't do. In this case:

Add a few rows, perhaps above your data so it will be at the top of
the spreadsheet. In this area:
 - In the first row, enter the names of the fields you want to filter on
 - In each following row, enter the values you want to filter on.
 - Select menu item Data -> Filter -> Advanced Filter
a dialog box should appear with three fields and a pair of buttons at
the top titled "filter the list, in place" and "copy to another
location". The three fields are as follows:
 - the first field should select the range of data to be filtered.
 - the second field should select the filter criteria (don't select
any extra lines)
 - the third field should select where to copy the data if you don't
filter in place

There is an additional explanation of criteria in the on line help,
but a few examples should illustrate the concept.

Title
*1234*

will match all records which have 1234 as part of the "Title".

Cost  Cost
>100  <200

will match all records where the cost is greater than 100 and less than 200

Title  Cost  Cost
*1234* >100  <200

will match all records where the Title contains 1234 and the cost is
within the range.

Title  Cost  Cost
*1234*
       >100  <200

will match all records where the Title contains 1234 OR the cost is
within the range.

Another advantage of this method allows you to make the record
matching a permanent part of the spreadsheet at the top of the data.

I consider this harder to set up and use than the other methods, but
it provides for more powerful searches if you need it.

[3] Adding a selector / buttons

Something similar in look to a dialog box but part of the sheet is to
reserve a couple cells near the top to enter the value to select on
and a pair of buttons. I would set up something like

Model Number
1234

with a pair of buttons to the right. If Model Number is in cell A1,
1234 is in cell A2, and the data starting in cell A4 (and subsequent
rows), you can set it up like this.

 a. Enter Model Number in A1
 b. Leave A2 blank until you are ready to do the search.
 c. Menu item View -> Toolbars -> Forms
 d. The button item is the second item on the right. Click on it.
 e. Click and drag over a blank area (a couple cells will do) and a
dialog box will appear. Set the Macro name of the first one to
FilterForm, and OK.
 f. Select the text in the button and change to Search, Match Records,
or whatever you want.
 g. Do a second button (steps d, e, f) and set the macro name to
ShowAll and the name to match.
 h. Menu item Tools -> Macro -> Visual Basic Editor
If you don't already use macros, use
 i. Menu item Insert -> Module
to create a module
 j. Copy / paste the following into a module.

Sub FilterForm()
'
' FilterForm Macro
' Macro recorded 2/3/2004 by Maniac
'

'
    Range("A4").Select
    Selection.CurrentRegion.Select
    Selection.AutoFilter
    a$ = Format(Range("A2").Value, "0")
    Selection.AutoFilter Field:=1, Criteria1:="=*" + a$ + "*", Operator:=xlAnd
End Sub

Sub ShowAll()
'
' ShowAll Macro
' Macro recorded 2/3/2004 by Maniac
'

'
    Range("A4").Select
    Selection.AutoFilter
End Sub

If you need a different column, change the Field:= value to the correct column.

I suggest saving the spreadsheet with the buttons / macros at this point.
 k. Excel -> Quit and return to Microsoft Excel
 l. File -> Save
and the new spreadsheet will have the search tool saved as part of the
overall spreadsheet.

At this point, you should be able to enter 1234 into A2 and click on
the Search button to select just the lines with 1234 in the column
referenced in the macro. You can click the Show All button to reset
back to the unfiltered data.

Another suggestion - not specific to searching for data, but will keep
the search capability on the screen. I find this especially helpful to
keep the column titles (and row titles) on the screen when I have a
large spreadsheet.

At the top right (above the vertical scroll bar) and bottom right
(right of the horizontal scroll bar) is a tool you can use to split
the worksheet horizontally and vertically. On my system it looks like
a gray oval (or blob). Click and drag the upper right one down a
couple rows to split the screen horizontally. The part above the split
will be the part always on the screen.

If you have a wide spreadsheet and want to keep a couple columns on
the left visible, click and drag the lower right one to the left.

Then do
  Window -> Freeze Panes
to lock the lines you have displayed at the top (and left).

If you make a mistake or want to remove this feature, use
  Window -> Unfreeze Panes
or
  Window -> Remove Split
to remove the frozen panes.

To help find the information needed for this answer, I searched
Excel's online documentation using phrases such as:
 filter
 match records
 freeze panes
 button
 field
for basic Excel command operation. For the macro, I recorded the basic
steps I wanted to use and then modified it using information from the
Object Browser, Immediate Window (for trying actions), and the Visual
Basic help to look up information.

One (or more) of these methods should give you the ability to look up
and view all the documents with 1234 (or any search string) within it.
If you have ANY problems with one or more of these or if any part is
unclear, please request a clarification. I am glad to help further if
needed.

  --Maniac
Comments  
Subject: Re: Setting up Micosoft Excel to allow me to "match records".
From: tuti-ga on 03 Feb 2004 09:52 PST
 
I've seen the Appleworks and the Match records is the same as fuctions
in Excel (Insert - Function). But i think as Maniac. The best could be
filters (Data - Filter). With the Data menu you can order, group and
macht records.
Subject: Re: Setting up Micosoft Excel to allow me to "match records".
From: erick_2200-ga on 04 Feb 2004 08:19 PST
 
You go to Data-Filter-Advance Filter.

You have to select the range where the data are.

and in the second range the range criteria range, with this you can
find all the data to have 1234 (for example) in all the data base.

Please see the example:
http://www.uic.edu/depts/accc/seminars/excel2000-intermed/databases-advanced.html

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy