Consider the table below:
A B C D
1 category subcategory company amount
2 health care diagnostics AA 100
3 health care diagnostics AB 50
4 materials mining BA 75
5 financials banks CA 30
6 financials insurers CB 35
7 financials banks CC 10
8 financials banks CD 40
9 financials hedge fund CE 5
10 health care equipment DA 50
I want to (1) concatenate the companies for each category and (2) return the aggregated amount.
A B C
1 category companies amount
2 health care AA AB DA 200 <--- 100 + 50 + 50
3 materials BA 75
4 financials CA CB CC CD CE 120
I am aware that (2) can easily be done by using a pivot table, but (1) is not supported by pivots. So given the excel below, what formula do I need in B1
and C1
to get the desired output?
A B C
1 category
2 health care
3 materials
4 financials
I have looked into concatenate()
, which is needed here, but I don't see how I can give arguments to that function, like pseudo:
=concatenate(C2:C10; "where (A:A) = 'health care')
Who can help me out?
question from:
https://stackoverflow.com/questions/65836751/concatenating-from-a-table-by-filtering-first 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…