Thread: VLOOKUP & Array
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
AlanR AlanR is offline
external usenet poster
 
Posts: 3
Default VLOOKUP & Array

Sorry, I wasn't clear when I asked the question:

I have a table of names (Column A) and values (Column B).

I want to take a list of cells, (eg A1:A9) and translate them into values,
then add them up.

So in Sheet1 I have:

A B
a 1
b 2
c 3
d 4
e 5
f 6
g 7
h 8
i 9

In Sheet2 I have:
A
a
a
a
a
b
c
d
g
i

So I want to total up the names by getting the values from Sheet1.

"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