+ Reply to Thread
Results 1 to 5 of 5

multiple columns with same variable to become 1 row at the pivot table

  1. #1
    Registered User
    Join Date
    02-21-2013
    Location
    Sorocaba
    MS-Off Ver
    Excel 2007
    Posts
    12

    multiple columns with same variable to become 1 row at the pivot table

    Hi everyone,

    I have to analyze the number of published articles by authors, however, pretty much all the articles have several authors, so I do not know how to use a pivot table to analyze that.

    Thatīs the example that I have.

    Column A (Article) - Column B (Author 1) - Column C (Author 2)
    Article 1 - Jose - Maria
    Article 2 - Jose - Joao

    I wanted a pivot table like this

    Author - Number of articles
    Jose - 2
    Maria - 1
    Joao 1

    I did not wanted to change the source table (meaning that the source should still be with 3 columns Article, Author 1 and Author 2)
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: multiple columns with same variable to become 1 row at the pivot table

    Hi,

    I'm sorry to say that you will need a 2 column table to do this pivot table. You need to move Author2 down under Author1. Then you can do a pivot table with the data.

    This is a common question and has many ways to do it. See one at:

    https://blogs.office.com/2015/12/15/...in-excel-2016/
    Last edited by MarvinP; 01-21-2017 at 10:14 PM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,025

    Re: multiple columns with same variable to become 1 row at the pivot table

    One way, not requiring a Pivot Table:

    In F2, copied down, use this array formula:

    =IFERROR(INDIRECT(TEXT(MIN(IF(($B$2:$C$10<>"")*(COUNTIF($F$1:F1,$B$2:$C$10)=0),ROW($2:$10)*100+COLUMN($B:$C),10^10)),"R0C00"),)&"","")

    In G2, copied down:

    =IF(F2="","",COUNTIF($B$2:$C$5,F2))

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Registered User
    Join Date
    02-21-2013
    Location
    Sorocaba
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: multiple columns with same variable to become 1 row at the pivot table

    thank you. I have excel 2016, but I was not able to follow those steps. Iīll look again after I try Glennīs comment

  5. #5
    Registered User
    Join Date
    02-21-2013
    Location
    Sorocaba
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: multiple columns with same variable to become 1 row at the pivot table

    Quote Originally Posted by Glenn Kennedy View Post
    One way, not requiring a Pivot Table:

    In F2, copied down, use this array formula:

    =IFERROR(INDIRECT(TEXT(MIN(IF(($B$2:$C$10<>"")*(COUNTIF($F$1:F1,$B$2:$C$10)=0),ROW($2:$10)*100+COLUMN($B:$C),10^10)),"R0C00"),)&"","")

    In G2, copied down:

    =IF(F2="","",COUNTIF($B$2:$C$5,F2))

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    I think that will work! thank you!

+ 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. Pivot Table, can't sum over multiple columns
    By Add1988 in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 10-20-2015, 03:49 AM
  2. Replies: 6
    Last Post: 08-19-2015, 07:46 PM
  3. Applying multiple values filters on a single variable (pivot table)
    By greengirl in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-29-2015, 08:24 PM
  4. Pivot table with multiple columns
    By jjin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2014, 10:50 PM
  5. Multiple Columns for Pivot Table
    By lamdl in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-15-2014, 01:22 PM
  6. [SOLVED] Multiple Columns in Pivot Table (but don't show in Pivot Chart)
    By Gideon1973 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 04-23-2012, 10:57 AM
  7. [SOLVED] Multiple columns in a pivot table
    By lyric2002 in forum Excel General
    Replies: 2
    Last Post: 05-26-2005, 05:15 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