+ Reply to Thread
Results 1 to 4 of 4

Stacking data into one column based on unique values and multiple source columns

  1. #1
    Registered User
    Join Date
    10-22-2015
    Location
    Helsinki
    MS-Off Ver
    Latest offive version
    Posts
    6

    Stacking data into one column based on unique values and multiple source columns

    Hi,

    My question is based on stacking data into one column based on three columns and unique values. Kindly refer to the attached excel for example. The trick that I am looking for is that if new unique cost object is added, then the column where the stack is would be updated to reflect this. For example now I have 6 rows for Value column one, this is since I have three unique values (output displayed twice) if there would be four unique cost objects then I would have 8 rows for one value column. This process would be repeated for value columns two and three in order to have the data in one huge column stack.

    Br,
    Ville
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    10-22-2015
    Location
    Helsinki
    MS-Off Ver
    Latest offive version
    Posts
    6

    Re: Stacking data into one column based on unique values and multiple source columns

    I am still stuck with this, anyone ideas?

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Stacking data into one column based on unique values and multiple source columns

    See the attached:

    in J2 and copy down:

    =IFERROR(IF(K2="","",INDEX($B$3:$B$20,MOD(ROWS($A$1:A1)-1,$G$2*2)+1)),"")

    in K2 and copy down

    =IFERROR(INDEX($C$2:$F$2,,INT((ROWS($A$1:A1)-1)/($G$2*2))+1),"")

    in L2

    =SUMPRODUCT(($C$3:$F$10)*($B$3:$B$10=$J2)*($C$2:$F$2=$K2))


    Note formulae use formula in G2 for count of unique values. I also changed the order of data in Input Data table
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Stacking data into one column based on unique values and multiple source columns

    I added some additions , including counts of both unique rows and columns, both of which are used in the formulae.

    the table will automatically change with additions/deletions to rows and/or columns.
    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. Count Unique values in Column based on values in other columns
    By dmschave in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-17-2014, 11:06 AM
  2. Replies: 1
    Last Post: 11-16-2013, 05:18 AM
  3. Replies: 9
    Last Post: 10-14-2013, 07:55 PM
  4. Replies: 2
    Last Post: 03-27-2012, 06:00 PM
  5. Replies: 11
    Last Post: 06-09-2011, 03:17 PM
  6. Replies: 5
    Last Post: 04-21-2011, 05:22 PM
  7. Summing columns based on another column containing unique values.
    By CJPHX in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-14-2010, 02:22 PM

Tags for this Thread

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