unknownymous

Board Regular
Joined
Sep 19, 2017
Messages
249
Office Version
  1. 2016
Platform
  1. Windows
Hi Gurus,

Could possibly help me formulate the codes so I can get the results like the Clean Sheet?

I just need to get the data per account per month in descending order and will exclude those accounts with zero shares.

Raw sheet

AccountNameNoteMar-19Feb-19Jan-19
0011008050
002505020
00310100
Total16014070

<tbody>
</tbody>

Clean Sheet

AccountNameQty
03/30/2019001100
03/30/201900250
03/30/201900310
02/28/201900180
02/28/201900250
02/28/201900310
01/31/201900150
01/31/201900220

<tbody>
</tbody>


Any help will be much appreciated.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Quickly accomplished using Power Query. Mcode below. Unpivot your data.

Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Account", Int64.Type}, {"Name", type any}, {"Note", type any}, {"19-Mar", Int64.Type}, {"19-Feb", Int64.Type}, {"19-Jan", Int64.Type}}),
    #"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Name", "Note"}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Removed Columns", {}, "Attribute", "Value"),
    #"Added Custom" = Table.AddColumn(#"Unpivoted Columns", "Custom", each if([Attribute]="Account") then [Value] else null),
    #"Filled Down" = Table.FillDown(#"Added Custom",{"Custom"}),
    #"Filtered Rows" = Table.SelectRows(#"Filled Down", each ([Attribute] <> "Account")),
    #"Reordered Columns" = Table.ReorderColumns(#"Filtered Rows",{"Attribute", "Custom", "Value"})
in
    #"Reordered Columns"
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,858
Members
449,051
Latest member
excelquestion515

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