View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default Sum values in columns based on values in named range

This array* formula will probably do it for you:

=SUM(IF(ISNUMBER(MATCH(D1:D100,people,0)),G1:G100) )

You can't use full-column references with array formulae (unless you
have Excel 2007), so adjust the ranges to suit your data.

*As this is an array formula, you have to commit it using CTRL-SHIFT-
ENTER (CSE) instead of the usual ENTER. If you do this correctly then
Excel will wrap curly braces { } around the formula when viewed in the
formula bar - do not type these yourself. If you edit/amend the
formula, use CSE again.

Hope this helps.

Pete

On Nov 11, 10:51*am, Mikael Andersson
wrote:
Hi,

hopefully i´m not in the wrong place to ask this.

I have a worksheet with a named range (people) currently 6 values there, one
column with lots of different values (Col D), and another column with numbers
(Col G). What i want to do is to sum values in Col G based on if Col D
contains any of the values in the named range "People".

tried SUMIF(D:D;people;G:G) and such, but i cant figure it out.

I´m probably just too stupid to see the obvious, but i really need help..

Best regards,

Mikael