+ Reply to Thread
Results 1 to 4 of 4

Expanding a summary cell into individual counts...opposite of consolidate?

  1. #1
    Registered User
    Join Date
    05-13-2013
    Location
    Boston, MA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Expanding a summary cell into individual counts...opposite of consolidate?

    Hi guys, I have run into an interesting issue that perhaps someone has some insight into.
    I have an excel spreadsheet which has data arranged perfectly for histograms. A column A of values, and column B of counts of said values. For example, A1 has 5, B1 has 40, signifying that 5 has been counted 40 times, and so on. This extends for row 2, 3, 4 etc.
    I would like to convert this data into individual numbers, such that column C would have 5, 40 times, then a second value for X number of times. It seems kind of similar to the opposite of consolidate, but I wasn't able to figure out a way to do it. Does anyone have any suggestions? It may seem trivial, but I have probably 10 spreadsheets each with about 200 rows, making it kind of impossible to do manually :p

    Any help or pointers would be greatly appreciated!
    Thanks
    Brian

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Expanding a summary cell into individual counts...opposite of consolidate?

    Insert a blank row 1, so that your data now starts in A2:B2, and enter zero in cell C1. Then in C2 you can use this formula:

    =SUM(B$1:B2)

    and copy this down to the bottom of the data that you have in columns A and B. This gives a cumulative total of the counts.

    Then you can put this formula in E2 (or wherever you like):

    =IF(ROWS($1:1)>MAX(C:C),"",INDEX(A:A,MATCH(ROWS($1:1)-1,C:C)+1))

    and copy this down as far as you think you need it (I've copied to E30 in the attached file). The values in column E are the ones you want.

    Hope this helps.

    Pete
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-13-2013
    Location
    Boston, MA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Expanding a summary cell into individual counts...opposite of consolidate?

    Oh my god. I have extremely rudimentary programming from years ago when I learned java, and I was thinking in my head if you could do recursive functions like that just in the cell instead of maybe a macro.
    I was looking more for guidelines on how to do it, but you went above and beyond lol.

    This is exactly what I was looking for, thanks very much!

  4. #4
    Registered User
    Join Date
    09-06-2015
    Location
    University Park, PA
    MS-Off Ver
    Mac 2016
    Posts
    1

    Re: Expanding a summary cell into individual counts...opposite of consolidate?

    Thank you!!!! Helping to "recode" a huge data set with this exact same issue and your solution just saved at least 36 hours of manual data re-entry and/or the time to figure out how to write VBA multi-conditional loops. Phew.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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