close

I have an array of numbers like
1000.01
2000.015
3000.02
4000.025
5000.03

say the range name is tab1

and an array of numbers like (call it tab2)
150
250
350
I want to look up the numbers from tab2 in tab1 and multilply it by the 2nd
column from tab1 and add up the result.
So, I want 150*.01 250*.015 350*.02

I tried as an array formula =sum((vlookup(tab2,tab1,2)*tab2)
but this does not work.
What should I be doing?

TIASay your tab2 info in col. A. In col. B type
vlookup(A1,tab1!$A$1:$B$5,2,TRUE) Note: Use quot;truequot; in the vlookup, since
your values in tab1 col. A and tab2 col. A are not exact matches... it will
find the closest match. Then, in col. C on tab2, type in =A1*B1.

quot;Sanford Lefkowitzquot; wrote:

gt; I have an array of numbers like
gt; 1000.01
gt; 2000.015
gt; 3000.02
gt; 4000.025
gt; 5000.03
gt;
gt; say the range name is tab1
gt;
gt; and an array of numbers like (call it tab2)
gt; 150
gt; 250
gt; 350
gt; I want to look up the numbers from tab2 in tab1 and multilply it by the 2nd
gt; column from tab1 and add up the result.
gt; So, I want 150*.01 250*.015 350*.02
gt;
gt; I tried as an array formula =sum((vlookup(tab2,tab1,2)*tab2)
gt; but this does not work.
gt; What should I be doing?
gt;
gt; TIA
gt;

Thanks, but this is not quite what I was looking for.
I am interested inthe SUM(a1*b1). I do not want the individual terms of the
sum.
I have several thousand lines of data like this, so I would prefer a formula
that gives me the sum without having to use cells to calculate the
constituent terms
(So, in the example, I want the answer '12.25' without having to list the 3
terms of the sum)

quot;JRquot; wrote:

gt; Say your tab2 info in col. A. In col. B type
gt; vlookup(A1,tab1!$A$1:$B$5,2,TRUE) Note: Use quot;truequot; in the vlookup, since
gt; your values in tab1 col. A and tab2 col. A are not exact matches... it will
gt; find the closest match. Then, in col. C on tab2, type in =A1*B1.
gt;
gt; quot;Sanford Lefkowitzquot; wrote:
gt;
gt; gt; I have an array of numbers like
gt; gt; 1000.01
gt; gt; 2000.015
gt; gt; 3000.02
gt; gt; 4000.025
gt; gt; 5000.03
gt; gt;
gt; gt; say the range name is tab1
gt; gt;
gt; gt; and an array of numbers like (call it tab2)
gt; gt; 150
gt; gt; 250
gt; gt; 350
gt; gt; I want to look up the numbers from tab2 in tab1 and multilply it by the 2nd
gt; gt; column from tab1 and add up the result.
gt; gt; So, I want 150*.01 250*.015 350*.02
gt; gt;
gt; gt; I tried as an array formula =sum((vlookup(tab2,tab1,2)*tab2)
gt; gt; but this does not work.
gt; gt; What should I be doing?
gt; gt;
gt; gt; TIA
gt; gt;

Well, you are going to have to use a vlookup in some form or another to
obtain the values from the other sheet. But, to get it all in one cell for
you, do this...

=vlookup(A1,tab1!$A$1:$B$5,2,TRUE)*A1 All I added was quot;*A1quot; to the end of
the vlookup so, it finds your value, then multiplies it. Since it is not
locked via dollar signs, you can just copy it down the page. Hope this works
for you.

quot;Sanford Lefkowitzquot; wrote:

gt; Thanks, but this is not quite what I was looking for.
gt; I am interested inthe SUM(a1*b1). I do not want the individual terms of the
gt; sum.
gt; I have several thousand lines of data like this, so I would prefer a formula
gt; that gives me the sum without having to use cells to calculate the
gt; constituent terms
gt; (So, in the example, I want the answer '12.25' without having to list the 3
gt; terms of the sum)
gt;
gt; quot;JRquot; wrote:
gt;
gt; gt; Say your tab2 info in col. A. In col. B type
gt; gt; vlookup(A1,tab1!$A$1:$B$5,2,TRUE) Note: Use quot;truequot; in the vlookup, since
gt; gt; your values in tab1 col. A and tab2 col. A are not exact matches... it will
gt; gt; find the closest match. Then, in col. C on tab2, type in =A1*B1.
gt; gt;
gt; gt; quot;Sanford Lefkowitzquot; wrote:
gt; gt;
gt; gt; gt; I have an array of numbers like
gt; gt; gt; 1000.01
gt; gt; gt; 2000.015
gt; gt; gt; 3000.02
gt; gt; gt; 4000.025
gt; gt; gt; 5000.03
gt; gt; gt;
gt; gt; gt; say the range name is tab1
gt; gt; gt;
gt; gt; gt; and an array of numbers like (call it tab2)
gt; gt; gt; 150
gt; gt; gt; 250
gt; gt; gt; 350
gt; gt; gt; I want to look up the numbers from tab2 in tab1 and multilply it by the 2nd
gt; gt; gt; column from tab1 and add up the result.
gt; gt; gt; So, I want 150*.01 250*.015 350*.02
gt; gt; gt;
gt; gt; gt; I tried as an array formula =sum((vlookup(tab2,tab1,2)*tab2)
gt; gt; gt; but this does not work.
gt; gt; gt; What should I be doing?
gt; gt; gt;
gt; gt; gt; TIA
gt; gt; gt;

On Tue, 20 Dec 2005 10:40:03 -0800, quot;Sanford Lefkowitzquot;
gt; wrote:

gt;I have an array of numbers like
gt; 1000.01
gt;2000.015
gt;3000.02
gt;4000.025
gt;5000.03
gt;
gt;say the range name is tab1
gt;
gt;and an array of numbers like (call it tab2)
gt;150
gt;250
gt;350
gt;I want to look up the numbers from tab2 in tab1 and multilply it by the 2nd
gt;column from tab1 and add up the result.
gt;So, I want 150*.01 250*.015 350*.02
gt;
gt;I tried as an array formula =sum((vlookup(tab2,tab1,2)*tab2)
gt;but this does not work.
gt;What should I be doing?
gt;
gt;TIA
gt;

Using your NAMEing, you could use this formula:

=SUMPRODUCT(tab2,LOOKUP(tab2,INDEX(tab1,,1),INDEX( tab1,,2)))

Note that INDEX(tab1,,1) and INDEX(tab1,,2) merely return the first and second
columns of tab1. So you could replace those terms with references to the
single columns (e.g. A1:A100 and B1:B100).

Also note that if any value in tab2 is less than the minimum value in tab1
col1, the formula will return #NA

HTH,

--ron

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()