ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Sumif/lookup ? Array (https://www.excelbanter.com/excel-discussion-misc-queries/133975-sumif-lookup-array.html)

svemor

Sumif/lookup ? Array
 
Hi

I have a list of categorys with a value in another colum, like this:

category_id Value
116 37
115 4
110 2
109 4
111 2
etc. etc.

There is about 150 category_id`s.

I want to group the category ids in to Groups and have made a list like this:
Group1 Group2 Group3 Group4
116 56 144 4
115 57 170
110 111 160
109 169

I`ve tried this array SUMIF formula;
[=SUMIF(Data!A2:A300;H6:H45;Data!B2:B300)] (the [] indicates the
array sign)
- But it only returned 37 for Group1. Should have returned 45 in the
excemple above (37+4+2+4) for Group1.

Can anyone help me get the right formula??

T. Valko

Sumif/lookup ? Array
 
Try this:

=SUMPRODUCT(--(ISNUMBER(MATCH(A2:A300,H6:H45,0))),B2:B300)

Biff

"svemor" wrote in message
...
Hi

I have a list of categorys with a value in another colum, like this:

category_id Value
116 37
115 4
110 2
109 4
111 2
etc. etc.

There is about 150 category_id`s.

I want to group the category ids in to Groups and have made a list like
this:
Group1 Group2 Group3 Group4
116 56 144 4
115 57 170
110 111 160
109 169

I`ve tried this array SUMIF formula;
[=SUMIF(Data!A2:A300;H6:H45;Data!B2:B300)] (the [] indicates the
array sign)
- But it only returned 37 for Group1. Should have returned 45 in the
excemple above (37+4+2+4) for Group1.

Can anyone help me get the right formula??





All times are GMT +1. The time now is 07:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com