Thread: vlookup
View Single Post
  #2   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

Sounds as though you could use

=SUMIF(Sheet1!$A$2:$A$500,A2,Sheet1!$C$2:$C$500)

or

=SUMPRODUCT(--(Sheet1!$A$2:$A$500=A2),Sheet1!$C$2:$C$500)

where A2 is the first category, copy down the formula

You could also use a pivot table


Regards,

Peo Sjoblom

"jg" wrote:

I would like to do the following calculation which I think should be done
with the vlookup function, but it may be another function.

I have a table containing 3 columns. Column A list the category (Clothing,
food etc.). Column B lists the item within the category (from Column A).
Column C lists the price of the item in column B. I would like to list on a
new table (on a different worksheet) all the categories (from the 1st table
in column A) on column A of the new table. I would like to have a formula in
column B of the new table totaling the price of all the items (from the 1st
table, column B) belonging to the category listed on column A of this row (in
the new table).
--

jg