View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.worksheet.functions
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default adding up vlookup values in one column and in between them

I think you're going to be better off using a variation of the SUMPRODUCT()
function. You don't tell us what type of values you're looking up - dates,
text, numbers? Nor have you mentioned their relationship to each other. It
would help to know that.

But lets say you have the information in 2 columns, and that the 'key'
values are in ascending order like this:
1 .1
1234 .2
2345 .3
3456 .4
4567 .5
9000 .6

and you want the sum of all numbers associated with values 1234 through
3456, inclusive, then this would do it for you:
=SUMPRODUCT(--(A1:A6=1234),--(A1:A6<=3456),B1:B6)
If you put the start/end values in a couple of cells, you can have a more
flexible situation. Lets say you put the lower limit in D1 and the upper
limit in E1, then your formula becomes:
=SUMPRODUCT(--(A1:A6=D1),--(A1:A6<=E1),B1:B6)

The results for both formulas should be .9 (.2+.3+.4)

But for this all to work as a "between" operation, the key values in column
A are going to have to be in sequential order, either ascending or descending.

Hope this helps some.


"observer" wrote:

Let me restate an earlier post so maybe its easier to understand...

I want to use vlookup for 2 values in a column and then I want to be
able to add them and all the numbers in between them (in that column)
to another cell. Can this be done and how? Please no VBA as I'm
not familiar with it. Thanks.