Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default Vlookup & 2 variables

Is it possible to use vlookup for 2 criteria? I want to go to another tab in
my workbook and lookup the value that meets 2 criteria. in the example below,
I need the id# and project id # to match values on the other tab and return
the $ value that matches both.

ID # Project ID Amount
123 0523 $1,000
456 0645 $2,000
789 0752 $4,000
028 0523 $5,000

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Vlookup & 2 variables

I'm assuming all your data with leading 0s is formatted as text.

Try this:

A1 = 028
B1 = 0523

=SUMPRODUCT(--(Sheet2!A1:A10=A1),--(Sheet2!B1:B10=B1),Sheet2!C1:C10)

--
Biff
Microsoft Excel MVP


"Marti" wrote in message
...
Is it possible to use vlookup for 2 criteria? I want to go to another tab
in
my workbook and lookup the value that meets 2 criteria. in the example
below,
I need the id# and project id # to match values on the other tab and
return
the $ value that matches both.

ID # Project ID Amount
123 0523 $1,000
456 0645 $2,000
789 0752 $4,000
028 0523 $5,000



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default Vlookup & 2 variables

I tried it, but it's not working. the data is all numbers, so I tried the
formula as written below and w/o the -- but still getting an error message

"T. Valko" wrote:

I'm assuming all your data with leading 0s is formatted as text.

Try this:

A1 = 028
B1 = 0523

=SUMPRODUCT(--(Sheet2!A1:A10=A1),--(Sheet2!B1:B10=B1),Sheet2!C1:C10)

--
Biff
Microsoft Excel MVP


"Marti" wrote in message
...
Is it possible to use vlookup for 2 criteria? I want to go to another tab
in
my workbook and lookup the value that meets 2 criteria. in the example
below,
I need the id# and project id # to match values on the other tab and
return
the $ value that matches both.

ID # Project ID Amount
123 0523 $1,000
456 0645 $2,000
789 0752 $4,000
028 0523 $5,000




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Vlookup & 2 variables

but still getting an error message

You tried this formula and got an error message?

=SUMPRODUCT(--(Sheet2!A1:A10=A1),--(Sheet2!B1:B10=B1),Sheet2!C1:C10)

What error message?

Try this array formula** :

A1 = lookup ID #
B1 = Project ID

=INDEX(Sheet2!C1:C10,MATCH(1,(Sheet2!A1:A10=A1)*(S heet2!B1:B10=B1),0))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP


"Marti" wrote in message
...
I tried it, but it's not working. the data is all numbers, so I tried the
formula as written below and w/o the -- but still getting an error message

"T. Valko" wrote:

I'm assuming all your data with leading 0s is formatted as text.

Try this:

A1 = 028
B1 = 0523

=SUMPRODUCT(--(Sheet2!A1:A10=A1),--(Sheet2!B1:B10=B1),Sheet2!C1:C10)

--
Biff
Microsoft Excel MVP


"Marti" wrote in message
...
Is it possible to use vlookup for 2 criteria? I want to go to another
tab
in
my workbook and lookup the value that meets 2 criteria. in the example
below,
I need the id# and project id # to match values on the other tab and
return
the $ value that matches both.

ID # Project ID Amount
123 0523 $1,000
456 0645 $2,000
789 0752 $4,000
028 0523 $5,000






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vlookup with multiple variables Sam Excel Worksheet Functions 9 August 14th 08 09:59 PM
VLOOKUP - TWO Variables RJB Excel Discussion (Misc queries) 4 December 13th 07 08:29 AM
VLOOKUP - Two Variables RJB Excel Discussion (Misc queries) 0 December 12th 07 06:49 AM
using VLookup with two variables to get results Scott@CW Excel Discussion (Misc queries) 2 March 28th 07 07:56 PM
vlookup Variables Megadrone Excel Worksheet Functions 2 November 28th 06 11:30 PM


All times are GMT +1. The time now is 09:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"