Thread: lookup function
View Single Post
  #5   Report Post  
Max
 
Posts: n/a
Default

"Ron" wrote
... trying to link the drivers sheet with the master order
sheet where it automatically selects those orders
for that particular driver
and list it all out with no blank rows.


Think this set up will deliver what you're looking for ..

Assume the sample source table is in Sheet1,
cols A to C, data from row2 down

CustN Order DriverN
Cust1 Ord1 Drv1
Cust2 Ord2 Drv2
Cust3 Ord3 Drv1
Cust4 Ord4 Drv3
Cust5 Ord5 Drv2
Cust6 Ord6 Drv2
etc

Use an empty col to the right, say col E?

Put in E1: =Sheet2!A1

Put in E2: =IF(C2="","",IF(C2=$E$1,ROW(),""))

Copy E2 down to say E100,
to cover the max expected data in the table

In Sheet2 (this will be your summary sheet)
------------

Cell A1 will be earmarked for input of the driver
(Input in A1, say: Drv2)

Paste the headers into A2:B2: CustN, Order

Put in A3:

=IF(ISERROR(SMALL(Sheet1!$E:$E,ROWS($A$1:A1))),"", INDEX(Sheet1!A:A,MATCH(SMA
LL(Sheet1!$E:$E,ROWS($A$1:A1)),Sheet1!$E:$E,0)))

Copy A3 across to B3, fill down to B101
(cover the same range as in Sheet1)

In A3:B3 down will be returned the desired results
for the input in A1, i.e. you'll get:

Drv2
CustN Order
----------------
Cust2 Ord2
Cust5 Ord5
Cust6 Ord6
( rest are blank rows )

Change the input in A1 to: Drv1

Drv1
CustN Order
---------------
Cust1 Ord1
Cust3 Ord3
( rest are blank rows )

And so on ..

You could also create a data validation list in A1 for easy selection of the
driver

Select A1
Click Data Validation
Under Allow: select "List"
Enter in Source: Drv1, Drv2, Drv3
Click OK

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----