Excel Brain Fog

jmd78

New Member
Joined
Sep 24, 2013
Messages
31
Help, I can not for the life of me figure out how to sift through the data in this small spreadsheet to ascertain and build a table
that shows the various unit sizes by unit types. I can use delete duplicates and get to the unique units, then countif to get the number of the units for each size and sum if to get the square footage by unit size, but this is over all of the unit types (both CC and NCC). My dilemma is how to do this and get the information seperated by the unit type. SEE FILE AT SHAREPOINT LINK: Unit Matrix.xlsx
Your help and sugestions are most appreciated.
 

Attachments

  • UNIT MIX.PNG
    UNIT MIX.PNG
    117.9 KB · Views: 11

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
With Power Query. three queries

All
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"UNIT#(lf)SIZE"}, {{"Count", each Table.RowCount(_), Int64.Type}, {"Square Feet", each List.Sum([#"SF#(lf)UNIT"]), type number}})
in
    #"Grouped Rows"

CC
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"UNIT#(lf)SIZE", "TYPE"}, {{"Count", each Table.RowCount(_), Int64.Type}, {"Square Feet", each List.Sum([#"SF#(lf)UNIT"]), type number}}),
    #"Filtered Rows" = Table.SelectRows(#"Grouped Rows", each ([TYPE] = "CC"))
in
    #"Filtered Rows"

NCC
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"UNIT#(lf)SIZE", "TYPE"}, {{"Count", each Table.RowCount(_), Int64.Type}, {"Square Feet", each List.Sum([#"SF#(lf)UNIT"]), type number}}),
    #"Filtered Rows" = Table.SelectRows(#"Grouped Rows", each [TYPE] = "NCC")
in
    #"Filtered Rows"
Unit Matrix.xlsx
HIJKLMNOPQRST
19UNIT SIZECountSquare FeetUNIT SIZETYPECountSquare FeetUNIT SIZETYPECountSquare Feet
2010x1053530010x10CC42420010x20NCC61200
2110x2019380010x20CC1326008x20NCC1160
2210x1518270010x15CC18270010x10NCC111100
238x1522408x15CC2240
248x1032408x10CC3240
2510x256150010x25CC61500
265x582005x5CC8200
2715x10345015x10CC3450
2810x5630010x5CC6300
295x1532255x15CC3225
308x201160
Rent Roll AsOf
 
Upvote 0
With Power Query. three queries

All
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"UNIT#(lf)SIZE"}, {{"Count", each Table.RowCount(_), Int64.Type}, {"Square Feet", each List.Sum([#"SF#(lf)UNIT"]), type number}})
in
    #"Grouped Rows"

CC
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"UNIT#(lf)SIZE", "TYPE"}, {{"Count", each Table.RowCount(_), Int64.Type}, {"Square Feet", each List.Sum([#"SF#(lf)UNIT"]), type number}}),
    #"Filtered Rows" = Table.SelectRows(#"Grouped Rows", each ([TYPE] = "CC"))
in
    #"Filtered Rows"

NCC
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"UNIT#(lf)SIZE", "TYPE"}, {{"Count", each Table.RowCount(_), Int64.Type}, {"Square Feet", each List.Sum([#"SF#(lf)UNIT"]), type number}}),
    #"Filtered Rows" = Table.SelectRows(#"Grouped Rows", each [TYPE] = "NCC")
in
    #"Filtered Rows"
Unit Matrix.xlsx
HIJKLMNOPQRST
19UNIT SIZECountSquare FeetUNIT SIZETYPECountSquare FeetUNIT SIZETYPECountSquare Feet
2010x1053530010x10CC42420010x20NCC61200
2110x2019380010x20CC1326008x20NCC1160
2210x1518270010x15CC18270010x10NCC111100
238x1522408x15CC2240
248x1032408x10CC3240
2510x256150010x25CC61500
265x582005x5CC8200
2715x10345015x10CC3450
2810x5630010x5CC6300
295x1532255x15CC3225
308x201160
Rent Roll AsOf
 
Upvote 0
Love the idea of using this, but I have never worked with it. No earthly idea how to apply even after watching several videos on Power Query. Ended up just doing it the old way, deleting duplicates, sorting to build a table for the index, and running if(and statements and countifs statements.
 
Upvote 0
Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

- Follow this link to learn how to install Power Query in Excel 2010 / 2013.

- Follow this link for an introduction to Power Query functionality.

- Follow this link for a video which demonstrates how to use Power Query code provided.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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