+ Reply to Thread
Results 1 to 4 of 4

Problem in the pivot table

  1. #1
    Forum Contributor
    Join Date
    05-21-2019
    Location
    Tabriz,Iran
    MS-Off Ver
    2010
    Posts
    188

    Problem in the pivot table

    Hi all,

    I have a table with 3 columns:

    Name Day Hour
    A Monday 8
    B Monday 10
    C Tuesday 8
    D Wednesday 8
    E Monday 11
    F Tuesday 9
    G Wednesday 11

    I am using a pivot table

    Row tables: Hour
    column tables: Day
    Values: Name

    Result: values: 1,1,1,.... I do not want this result


    Result: values: A,B,C,... I want this result

    Is it Possible?

    Many Thanks for help me!
    Attached Files Attached Files
    Last edited by Yaghoub61; 03-23-2020 at 09:58 AM.
    Notice:
    my main language is not English

  2. #2
    Forum Contributor
    Join Date
    03-18-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2016 / 2019
    Posts
    251

    Re: Problem in the pivot table

    Hi,

    Using conditional formatting to do it, a bit primitive and if you got a lot of mapping then will be tedious

    Insert a mapping ID A=1, B=2, C=3 ........ then create rules for each character in conditional formatting,
    you need to off the grand totals for row and column and use count formulae


    if you have excel 2013 and above, perhaps using Power Query is a better way if you really wanted such presentation

    Rgds
    Attached Files Attached Files
    Christopher Yap

  3. #3
    Forum Contributor
    Join Date
    05-21-2019
    Location
    Tabriz,Iran
    MS-Off Ver
    2010
    Posts
    188

    Re: Problem in the pivot table

    Superb!

    BlueSky63, your job was so good!

    Thanks a lot!

  4. #4
    Forum Contributor
    Join Date
    03-18-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2016 / 2019
    Posts
    251

    Re: Problem in the pivot table

    Use Power query will be easier

    let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Removed Columns1" = Table.RemoveColumns(Source,{"ID"}),
    #"Grouped Rows1" = Table.Group(#"Removed Columns1", {"Hour"}, {{"Grouped", each _, type table [Name=text, Day=text, Hour=number]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows1", "Custom", each Table.RowCount([Grouped])),
    #"Renamed Columns" = Table.RenameColumns(#"Added Custom",{{"Custom", "Count Name"}}),
    #"Expanded Grouped" = Table.ExpandTableColumn(#"Renamed Columns", "Grouped", {"Name", "Day"}, {"Name", "Day"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Expanded Grouped",{{"Count Name", type number}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Day]), "Day", "Name"),
    #"Reordered Columns" = Table.ReorderColumns(#"Pivoted Column",{"Hour", "Monday", "Tuesday", "Wednesday", "Count Name"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Reordered Columns",{{"Hour", type number}})
    in
    #"Changed Type1"
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 01-24-2017, 06:56 PM
  2. Problem with pivot table
    By Navin Agrawal in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 03-30-2016, 07:19 PM
  3. Pivot table problem - how to relate 3 sheets' data into 1 pivot table?
    By GRG Stevan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-14-2015, 06:12 AM
  4. VBA Pivot Table: Problem with pivot item visibility
    By rotown21 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-22-2013, 03:56 AM
  5. Pivot Table Problem
    By amirah_almu7aka in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2012, 04:22 PM
  6. Pivot Table Problem
    By Tjbaer in forum Excel General
    Replies: 7
    Last Post: 08-26-2009, 12:03 PM
  7. [SOLVED] Pivot table problem
    By Ross in forum Excel General
    Replies: 1
    Last Post: 11-24-2005, 02:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1