View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Look up 2 values, return result in a different workbook

Have the file that contains this data open:

Jack 0 $35,000
Allen 2 $45,000
Jack 3 $46,000
Mike 4 $72,000


In a cell in the file where you want the formula start typing in the
formula:

=SUMPRODUCT(--(

Now, navigate to the open source file and select the sheet and range for the
name. Excel will add the file name for you. It'll look something like this:

=SUMPRODUCT(--([file.xls]Sheet1!$A$1:$A$10

Now, start typing again and add the criteria for the name:

="Jack"),--(

Now, point to the range for the ID# then start typing again and add the
criteria for the ID#:

=3),

Now, point to the range for the salary then finish the formula by typing a
closing ).

When you're done the formula should look like this:

=SUMPRODUCT(--([file.xls]Sheet1!$A$1:$A$10="Jack"),--([file.xls]Sheet1!$B$1:$B$10=3),[file.xls]Sheet1!$C$1:$C$10)

Pointing to the ranges in the open source file is *much* easier than typing
all that stuff in.

Biff

"Positive" wrote in message
oups.com...
I need to look up name and then id then return the salary to a
different workbook.
e.g
Jack 0 $35,000
Allen 2 $45,000
Jack 3 $46,000
Mike 4 $72,000

I want to look up Jack who has id #3 and put his salary to a DIFFERENT
WORKBOOK.

Please help