Thanks Mack,
For case 1, your solution is exactly what I'm looking. Thanks so much.

Just to expand the topic:
  • As there are 5 criteria in the data sheet, so there are dozens of possible criterion group.
  • With this way of merging all criteria into 1 criterion, for each criteria group we have to have build want additional column.
This is quite unconvinced, so I have to try to use array function, the purpose is to avoid building additional column in data sheet:
= {SUMIF(Data!$D$1:$D$300&Data!$E$1:$E$300,Need!$Q$7:$Q$307,Data!$K$7:$K$307) }

But it did not work.

For case 2: It is in the same concern, because I can not edit the datasheet. In the file I sent, the datasheet is in the same file, but actually, it is a separated file with more than 200sheets.

@Paul:
Please find attached for your more info. Data base function and pivot table dont give me the flexibility in structure the report, So I have to use other function.