Thread: VLOOKUP & Array
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Domenic[_2_] Domenic[_2_] is offline
external usenet poster
 
Posts: 265
Default VLOOKUP & Array

Try...

=SUMPRODUCT(--ISNUMBER(MATCH(A1:A3,{"a","b","c"},0)),B1:B3)

Note, however, if "a", "b", or "c" occur more than once in the range
A1:A3, all corresponding values in Column B will be summed.

Hope this helps!

http://www.xl-central.com

In article ,
AlanR wrote:

I have a sheet that looks like:
A B
a 1
b 2
c 3

=vlookup("a",A1:B3,2,0)=1
=vlookup("b",A1:B3,2,0)=2
=vlookup("c",A1:B3,2,0)=3

I want to add values {"a","b","c"}, so

=sum(vlookup({"a","b","c"},A1:B3,2,0))=sum({1,2,3} )=6