Microsoft Office Forums


Reply
 
 
crapit
Guest
Posts: n/a

 
      03-07-2010, 10:25 AM
How do I use vlookup if ret =abcd, dept = 999 and return value of no = 4 ?

ret dept no
abdf 123 1
abcd 234 2
defg 999 3
abcd 999 4
rgrg 456 5
wdff 547 6
abcd 888 7




 
Reply With Quote
 
 
 
 
Roger Govier
Guest
Posts: n/a

 
      03-07-2010, 11:10 AM
Hi
One way
=SUMPRODUCT((A2:A8="abcd")*(B2:B8=999),C2:C8)

--
Regards
Roger Govier

crapit wrote:
> How do I use vlookup if ret =abcd, dept = 999 and return value of no = 4 ?
>
> ret dept no
> abdf 123 1
> abcd 234 2
> defg 999 3
> abcd 999 4
> rgrg 456 5
> wdff 547 6
> abcd 888 7
>
>
>
>

 
Reply With Quote
 
Jason
Guest
Posts: n/a

 
      03-08-2010, 07:31 PM
Another way is to add a 'helper' column in which you concatenate the two
fields on which you wish to match the criteria - in this case 'ret' and
'dept'.

Add a new column anywhere before the 'no' column and concatenate the two
fields, i.e. if 'ret' and 'dept' are in columns A and B, you could add a
new column (col C) and add the formula =A2&B2, then copy this down.

Then use the new concatenated field as the vlookup key, i.e. if you
wanted to lookup the ret =abcd, dept = 999 from your example:

=VLOOKUP("abcd"&"999",C210,2,false)

HTH

Jason

I'd personally go with the SUMPRODUCT and save on the need for helper
data. However, don't just use it and not understand how it works -
research how it works as it can be very powerful.






Roger Govier wrote:
> Hi
> One way
> =SUMPRODUCT((A2:A8="abcd")*(B2:B8=999),C2:C8)
>
> --
> Regards
> Roger Govier
>
> crapit wrote:
>> How do I use vlookup if ret =abcd, dept = 999 and return value of no
>> = 4 ?
>>
>> ret dept no
>> abdf 123 1
>> abcd 234 2
>> defg 999 3
>> abcd 999 4
>> rgrg 456 5
>> wdff 547 6
>> abcd 888 7
>>
>>
>>
>>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Vlookup Function David Nolan Excel Newsgroup 9 02-28-2010 01:13 AM
incorporate paste value in vlookup bigproblem Excel Newsgroup 1 02-23-2010 07:20 PM
Excel 2007 and VLookup Alain R. Excel Newsgroup 3 02-21-2010 07:28 PM



All times are GMT. The time now is 02:15 PM.