View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JLatham JLatham is offline
external usenet poster
 
Posts: 2,203
Default Sharing Info between two workbooks?


Absolutely. You can use the VLookup() function across workbooks.
Start with both workbooks open.
In BookA.xls on Sheet1 you might have this layout:
A B
1 Product Prod#
2 Hose H4
3 Tile T1
4 Nails 6p N6p

in BookB.xls on your customer orders sheet you need a cell to enter the
Product, for example's sake we will say it is in A1 and you want Prod# to
appear in B1

A B
1 Tile =VLOOKUP(A1,[BookA.xls]Sheet1!$A$2:$B$4,2,FALSE)

You can do this easily from the keyboard:
Select cell B1
type =VLOOKUP(
click in cell A1 and type a comma so that it now looks like
=VLOOKUP(A1,
and choose BookA, the correct sheet and highlight the entire group of cells
that contains both your list of products and their product numbers
Type a comma followed by 2,FALSE) and hit [enter]

The 2 in the formula means that the information you want is in the 2nd
column of the table you are using to look up matching information from. The
,FALSE means that the list of products does not have to be in sorted order.

If you enter something on the customer order sheet that does not match any
item in the product list, this will give you a #NA error. You can cover that
eventuality by changing that formula to look like this (split here, but would
be all one long formula in your workbook)
=IF(ISNA(VLOOKUP(A1,[BookA.xls]Sheet1!$A$2:$B$4,2,FALSE)),"Not A
Product",=VLOOKUP(A1,[BookA.xls]Sheet1!$A$2:$B$4,2,FALSE))



"Christine" wrote:

I have two seperate spreadsheets, one inventory (A) and one for customer
orders (B). In (A) I have listed product name along with product number. Is
it possible to enter the name of product in spreadsheet (B)
and have the next cell automatically fill in product number from spreadsheet
(A)?