Applying fn to entire rows if a column fills a conditional, and displaying sequentially?

mischifous

New Member
Joined
Mar 14, 2016
Messages
35
Office Version
  1. 365
Platform
  1. Windows
Hi guys,

I would like to thank whoever gives this a go ; I know that you guys do this just because you are nice people. So thank you.

I would like to be able to do the following:
qwFG2cv.png

raNuV2L
Zz2ty8g



The above black text is how my data is structured. This data constantly sees rows inserted and deleted, and they are not in any particular order. I would like to be able to somehow, aggregate rows that have the same "Underlier" (or column B). In the above, groups of rows 3 and 7, and rows 4 and 6, are combined to form single row for AYX and AMZN, respectively, as shown in the blue text (rows 13 and 14). That is request #1 , and is the more important one.

Secondarily, it would be great if whichever method this is best accomplished by, would also make sure that whatever output format, the rows are displayed consecutively, as showed by the blue text. =

Sounds like it would be easy but I haven't had any success. I'll need to use the INDEX() function, right? Any help appreciated, tyvm
 
Last edited by a moderator:

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Try PowerQuery, Group by first and second column and Sum other two


Symbol
Underlier
Cost
Val
Symbol
Underlier
Cost
Val
CRSP us equityCRSP
1768​
2209​
CRSP us equityCRSP
1768​
2209​
AYX us equityAYX
4863​
6754​
AYX us equityAYX
12342​
16696​
AMZN us equityAMZN
9129​
9086​
AMZN us equityAMZN
14399​
18172​
NOW us equityNOW
1512​
3127​
NOW us equityNOW
1512​
3127​
AMZN us equityAMZN
5270​
9086​
GE us equityGE
2360​
1045​
AYX us equityAYX
2359​
3188​
GE us equityGE
2360​
1045​
AYX us equityAYX
5120​
6754​

<tbody>
</tbody>
 
Last edited:
Upvote 0
I forgot to add M code:

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Symbol", type text}, {"Underlier", type text}, {"Cost", Int64.Type}, {"Val", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Symbol", "Underlier"}, {{"Cost", each List.Sum([Cost]), type number}, {"Val", each List.Sum([Val]), type number}})
in
    #"Grouped Rows"[/SIZE]
 
Upvote 0
A formula approach for you to consider too.
F2 and G2 copied down as far as the column A data.
H2 is copied across and down.

Excel Workbook
ABCDEFGHI
1SymbolUnderlierCostValSymbolUnderlierCostVal
2CRSP us equityCRSP17682209CRSP us equityCRSP17682209
3AYX us equityAYX48636754AYX us equityAYX1234216696
4AMZN us equityAMZN91299086AMZN us equityAMZN1439918172
5NOW us equityNOW15123127NOW us equityNOW15123127
6AMZN us equityAMZN52709086GE us equityGE23601045
7AYX us equityAYX23593188
8GE us equityGE23601045
9AYX us equityAYX51206754
10
Combine data
 
Upvote 0

Forum statistics

Threads
1,216,122
Messages
6,128,964
Members
449,480
Latest member
yesitisasport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top