Agree with Jason that using Autofilter is easiest / best suited.
However, if for some reason, the data table needs to be, say
hidden away from sight / harm, but with user lookup/search
allowed on the table, give this set-up a try:
Assuming your data table is
in Sheet1, cols A and B,
data from row2 down, with:
col A = Part No.
col B = Work Order
In a new sheet, say, Sheet2
--------------------------------
Put the labels:
in A1 = Part No.
in B1 = Work Order
Cell A2 will be where the Part No. will be input
Put in C2:
=IF(OR(ISBLANK($A$2),ISERROR(OFFSET(Sheet1!$A$1,SEARCH("*"&TRIM($A$2)&"*",Sh
eet1!A2)+ROW()-2,1))),0,OFFSET(Sheet1!$A$1,SEARCH("*"&TRIM($A$2)&"*",Sheet1!
A2)+ROW()-2,1))
Copy C2 down as many rows as you have data in Sheet1
(This col C will be hidden eventually)
Put in B2: =LARGE(C:C,ROW()-1)
Copy B2 down as many rows as you have data in Sheet1
[The above will move all the "valid" work orders
-- for matched rows in col C -- to the top* and
shift all the zeros - for unmatched rows in col C -- to the bottom]
*In descending order
Now to dress up col B ..
---------------------------------
Select col B
Click Format > Conditional Formatting
Under Condition 1, make the settings:
Cell value is | equal to | 0 < type a "zero"
Click Format > Font tab > Color > choose "White"** > OK
**or the color matching the fill / background color
Click OK at the main dialog
(This will mask all cells with "zeros" in col B)
-------------------------
Now hide col C (and also Sheet1), and you're all set to go.
Try a test input in A2, e.g. : 123 (Part no.)
The results [i.e. Work Orders] will appear in B2 downwards
For the test input, based on your sample data,
the results would be: 6010, 6000 (in B2:B3)
--
Rgds
Max
xl 97
----------------------------------
Use xdemechanik <at>yahoo<dot>com for email
-----------------------------------------
Albuquerque Bill said:
Is there any way to lookup multiple answers to a lookup formula.
Normally, Excel will stop at the first match it finds and return that as the
answer when, in fact, there may be more than one answer. I want to find the
other matches as well and list them separately.
Here's an example.
Part No. Work Order
123 6000
123 6010
130 7000
135 7050
Part No. 123 has 2 (production) work orders associated with it: 6000 and
6010. I want to do a lookup of Part No. 123 and find ALL the work orders
associated with it (listed separately, of course). Is there any way to do
this in Excel? Thanks