Combine data from different rows matching multiple criteria into one row

pr1ncess426

New Member
Joined
Sep 18, 2016
Messages
14
I have a large amount of data that represents colors at different time points for specific identifiers (a, b, c, and so on...). The identifiers are listed with their corresponding color/time point, however if a single identifier has multiple colors (and therefore time points) assigned to it then that identifier is listed several times (each new color/time point combo gives populates as a new row assigned to that identifier).

I need to create a cleaned up spreadsheet where each identifier is only listed once (one row per identifier) with the columns next to it containing all of the corresponding color and time point data on that same row.

I would like the final product to look something like this:

1:00PM 2:00PM 3:00PM
a yellow purple
b red
c black violet pink
d orange green


Due to the specifics of my project, I need to clean up the data using only an excel formula that will update automatically even as my "given data" input changes. I'm also trying to avoid using helper columns or clunky formulas as much as possible, as my original data set is rather large. Any suggestions?

Screen Shot 2020-03-17 at 8.05.27 PM.png
 
Changing the format won't actually change the way it's treated. Here's an example with all numeric and works OK.
Try the K18 and L18 TYPE entries. Both should return 1 to indicate a number and then the ($A$18:$A$28=$F18) will work.

Pr1ncess426.xlsx
ABCDEFGHIJKL
1GIVEN DATACLEANED UP DATA
16
171:002:003:001:002:003:00
18122133 2211
19133244  
202443665577
21355488 99
223665 111222
233776 333 
24488
25499
265111
275222
286333
Numbers3
Cell Formulas
RangeFormula
F18:F23F18=INDEX($A$18:$A$28,MATCH(0,INDEX(COUNTIF($F$17:$F17,$A$18:$A$28),),0))
G18:I23G18=IFERROR(INDEX(B$18:B$28,AGGREGATE(15,6,ROW($A$18:$A$28)-ROW($A$17)/((B$18:B$28<>"")*($A$18:$A$28=$F18)),1)),"")
K18K18=TYPE(A18)
L18L18=TYPE(F18)
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I agree, it sounds as if the cell contents are being treated as text. You might try placing a 1 in some cell outside the table. Copy to the clipboard and then select your F column cells where the formulas are giving a problem and perform Paste > Special (Multiply) to force a conversion to numeric values.
 
Upvote 0
Thanks, Kirk. Would highlighting all of my data and formatting those cells as "Number" accomplish the same thing? I tried doing this but am still not getting outputs beyond the first instance (as described in my previous message).
 
Upvote 0
As previously stated the changing of the format doesn't change how it's treated.
What were the results of checking the type of your data and the unique list?
=TYPE(A18)
=TYPE(F18)
 
Upvote 0
@Toadstool's advice is spot on...trying to format the cells as Number is not sufficient. Sometimes you have to coerce the values to convert by doing something different from just changing the cell format.
 
Upvote 0
Checking the data type yields numbers (1 and 1).

Sorry for the tiny text, but here is an example with my original data that depicts what I am seeing now.

Screen Shot 2020-03-20 at 11.25.17 AM.png
 
Upvote 0
So it looks as if the formula is not picking up some values in the source/data table? For example, 111,11.9 and 111,15 are missing in the summary? I don't see any issues with your version. Here's a working version that I set up to maintain the same row/column setup as you. I used a slightly modified version of the unique list formula (that must be confirmed as a array formula by entering with Ctrl-Shift-Enter), but that shouldn't affect the other formula. Copy my AB3 formula and paste it into your AB3 cell and then copy across that row to see if it pulls all of the values...I may be missing something in the screenshot you sent.

Book1.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
1
2ID0:001:002:003:004:00ID0:001:002:003:004:00
311112.511112.59911.914 
411199222661016.8  
511111.93331012151617
611114      
722210      
822266      
922216.8      
1033312      
1133315      
1233310      
1333316      
1433317      
Sheet5
Cell Formulas
RangeFormula
AA2:AF2AA2=A2
AA3:AA14AA3=IFERROR(INDEX($A$3:$A$1000,MATCH(0,COUNTIF($AA$2:$AA2,$A$3:$A$1000&"") + IF($A$3:$A$1000="",1,0), 0)), "")
AB3:AF14AB3=IFERROR(INDEX(B$3:B$1000,AGGREGATE(15,6,ROW($A$3:$A$1000)-ROW($A$2)/((B$3:B$1000<>"")*($A$3:$A$1000=$AA3)),1)),"")
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 
Upvote 0
I copied in both the new AA3 and AB3 formulas and pressed CTRL+SHIFT+ENTER as you suggested. When I drag the AB3 formula to fill the remaining cells in that row (AB3->AY3), my cleaned up data is still missing values (11.9, 14, 15, etc... for identifier 111 for example).

I noticed your working version only goes through column F, but mine goes through column Y. Could this have anything to do with it?
 
Upvote 0
It's working for me as well. I've added an IFERROR around the unique Id column AA and you can get rid of the last 0 by formatting as Custom ##### but I'm getting the multiple entries.

Please note: The 222 Id has a 66 and a 12 in column B on rows 17 and 24 so this will only pick up the 66, i.e. the first.

I've only entered data for 111 and 222 and I've hidden the columns with empty data/results.

Cell Formulas
RangeFormula
AS2:AY2,AC2:AD2,R2:Y2,C2:D2C2=B2+TIME(1,0,0)
AA3:AA25AA3=IFERROR(INDEX($A$3:$A$1000,MATCH(0,INDEX(COUNTIF($AA$2:$AA2,$A$3:$A$1000),),0)),"")
AS3:AY16,AB3:AD16AB3=IFERROR(INDEX(B$3:B$1000,AGGREGATE(15,6,ROW($A$3:$A$1000)-ROW($A$2)/((B$3:B$1000<>"")*($A$3:$A$1000=$AA3)),1)),"")
AS17:AY25,AB17:AD25AB17=IFERROR(INDEX(B$3:B$13,AGGREGATE(15,6,ROW($A$3:$A$13)-ROW($A$2)/((B$3:B$13<>"")*($A$3:$A$13=$AA17)),1)),"")
 
Upvote 0
I'm curious...for any one of the missing values, try deleting that value from your data table and then reenter the number and tell us if the summary table picks it up. I'm wondering if some hidden characters might be involved.
 
Upvote 0

Forum statistics

Threads
1,215,106
Messages
6,123,124
Members
449,096
Latest member
provoking

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
Back
Top