How to pivot a data sheet to count multiple columns with Yes/No entries

Highlander Mc

New Member
Joined
Jun 11, 2016
Messages
2
Hi

I'm trying to pivot the following scenario:

ChairsTablesCarpets
Room 1YesYesYes
Room 2NoYesYes
Room 3NoNoYes
etc

<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>
</tbody>

To give the following answer
YesNoTotal
Chairs123
Tables213
Carpets303

<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>
</tbody>

Currently my efforts just seem to stack the different Yes/No on top of each other. Is it possible to achieve the above?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

sandy666

Banned - Rules violations
Joined
Oct 24, 2015
Messages
7,499
With PowerQuery

ItemsChairsTablesCarpetsCount of ItemsValue
Room 1YesYesYesAttributeYesNoGrand Total
Room 2NoYesYesCarpets
3​
0​
3​
Room 3NoNoYesChairs
1​
2​
3​
Tables
2​
1​
3​

step1
Load source table into PQ editor then
Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Items"}, "Attribute", "Value")
in
    #"Unpivoted Other Columns"[/SIZE]

step 2
insert PivotTable from external data source (eg. Query - Table1)
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,129,430
Messages
5,636,227
Members
416,908
Latest member
Streetsweeper

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
Top