• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Sort & Sum Through Excel Formula

kme

Member
Excel formula Required

Hear attached Data Sheet a Group Company Sales and Profit Under Different branches .

We Need sort Through Excel Formula Based On each employee name. Sample Answer Given In 2nd Sheet.

Sales and Profit amount Should be the sum of the division under Salesman

1737888017916.png
 

Attachments

  • FORMULA LOOKUP (6).xlsx
    29.8 KB · Views: 5
Code:
=GROUPBY(HSTACK('Sales Data'!$K$2:$K$163,'Sales Data'!$A$2:$A$163,'Sales Data'!$J$2:$J$163,'Sales Data'!$L$2:$L$163),'Sales Data'!$G$2:$H$163,SUM,3,0)
 
An alternative with Power Query
Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"Market", "Employee name", "Branch Name"}, {{"Total Sales", each List.Sum([Sales Amount]), type number}, {"Total Profit", each List.Sum([Profit]), type number}}),
    #"Reordered Columns" = Table.ReorderColumns(#"Grouped Rows",{"Market", "Branch Name", "Employee name", "Total Sales", "Total Profit"}),
    #"Sorted Rows" = Table.Sort(#"Reordered Columns",{{"Branch Name", Order.Ascending}, {"Market", Order.Ascending}})
in
    #"Sorted Rows"
 

Attachments

  • FORMULA LOOKUP (6).xlsx
    40.1 KB · Views: 1
Back
Top