Better Formula for Combining data into one cell for unique instances

tsimp42

New Member
Joined
Feb 8, 2022
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hello,

Looking for a better option to combine the data in Suffix Column to the Suffix Combo column when the UID repeats.

Current Formula:
=if(AH11=AH10,AJ10&", "&AI11,AI11)

For the last 2 rows in this sheet the UID is the same. Rather than only seeing the full combination of all suffix in the 2nd row would like to see it in both rows.

UID (AH)Suffix (AI)Suffix Combo (AJ)
100098504453943235QZ, QS, P3, N/AQZ, QS, P3, N/A
100101504453143239QZ, QS, P2, N/AQZ, QS, P2, N/A
100104664454545378AA, P2, QS, N/AAA, P2, QS, N/A
100104894453219328QZ, P3, N/A, N/AQZ, P3, N/A, N/A
100104894456019328QZ, P3, N/A, N/AQZ, P3, N/A, N/A
100105504453659409QZ, P2, N/A, N/AQZ, P2, N/A, N/A
100106684455027096NLT, N/A, N/A, N/ALT, N/A, N/A, N/A
100107164455327447QZ, P2, N/A, N/AQZ, P2, N/A, N/A
100107724454549650QZ, QS, P3, N/AQZ, QS, P3, N/A
100108414453659820QK, P1, N/A, N/AQK, P1, N/A, N/A
100108414453659820QX, P1, N/A, N/AQK, P1, N/A, N/A, QX, P1, N/A, N/A
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
If the UID was repeated 3 times, would you want the suffix to be repeated 3 times in every cell as well?
 
Upvote 0
I copied the above data and dropped it into a spreadsheet, A2:C13, your headers are in row 2.

Then I entered an embedded IF formula to consider if there is a matching suffix entry above or below the row I'm looking at. =IF(A12=A11,B11&" "&B12,IF(A12=A13,B12&" "&B13,B12))

Got these results for the last two rows.
QK, P1, N/A, N/A QX, P1, N/A, N/A

QK, P1, N/A, N/A QX, P1, N/A, N/A
 
Upvote 0
Ok, how about
+Fluff 1.xlsm
AHAIAJ
1
2100098504453943235QZ, QS, P3, N/AQZ, QS, P3, N/A
3100101504453143239QZ, QS, P2, N/AQZ, QS, P2, N/A
4100104664454545378AA, P2, QS, N/AAA, P2, QS, N/A AX, P2, QS, N/A AI, P2, QS, N/A
5100104664454545378AX, P2, QS, N/AAA, P2, QS, N/A AX, P2, QS, N/A AI, P2, QS, N/A
6100104664454545378AI, P2, QS, N/AAA, P2, QS, N/A AX, P2, QS, N/A AI, P2, QS, N/A
7100105504453659000QZ, P2, N/A, N/AQZ, P2, N/A, N/A
8100106684455027096NLT, N/A, N/A, N/ALT, N/A, N/A, N/A
9100107164455327000QZ, P2, N/A, N/AQZ, P2, N/A, N/A
10100107724454549000QZ, QS, P3, N/AQZ, QS, P3, N/A
11100108414453659820QK, P1, N/A, N/AQK, P1, N/A, N/A QX, P1, N/A, N/A
12100108414453659820QX, P1, N/A, N/AQK, P1, N/A, N/A QX, P1, N/A, N/A
Primary
Cell Formulas
RangeFormula
AJ2:AJ12AJ2=TEXTJOIN(" ",,FILTER($AI$2:$AI$100,$AH$2:$AH$100=AH2))
 
Upvote 0
Solution
I copied the above data and dropped it into a spreadsheet, A2:C13, your headers are in row 2.

Then I entered an embedded IF formula to consider if there is a matching suffix entry above or below the row I'm looking at. =IF(A12=A11,B11&" "&B12,IF(A12=A13,B12&" "&B13,B12))

Got these results for the last two rows.
QK, P1, N/A, N/A QX, P1, N/A, N/A

QK, P1, N/A, N/A QX, P1, N/A, N/A
Thank you. Think this assumes the UID is only 2 instances and immediately precedes and follows the original UID; unfortunately my data is not consistently in that format. That would be too easy. Thanks again. Have a great day.
 
Upvote 0
Ok, how about
+Fluff 1.xlsm
AHAIAJ
1
2100098504453943235QZ, QS, P3, N/AQZ, QS, P3, N/A
3100101504453143239QZ, QS, P2, N/AQZ, QS, P2, N/A
4100104664454545378AA, P2, QS, N/AAA, P2, QS, N/A AX, P2, QS, N/A AI, P2, QS, N/A
5100104664454545378AX, P2, QS, N/AAA, P2, QS, N/A AX, P2, QS, N/A AI, P2, QS, N/A
6100104664454545378AI, P2, QS, N/AAA, P2, QS, N/A AX, P2, QS, N/A AI, P2, QS, N/A
7100105504453659000QZ, P2, N/A, N/AQZ, P2, N/A, N/A
8100106684455027096NLT, N/A, N/A, N/ALT, N/A, N/A, N/A
9100107164455327000QZ, P2, N/A, N/AQZ, P2, N/A, N/A
10100107724454549000QZ, QS, P3, N/AQZ, QS, P3, N/A
11100108414453659820QK, P1, N/A, N/AQK, P1, N/A, N/A QX, P1, N/A, N/A
12100108414453659820QX, P1, N/A, N/AQK, P1, N/A, N/A QX, P1, N/A, N/A
Primary
Cell Formulas
RangeFormula
AJ2:AJ12AJ2=TEXTJOIN(" ",,FILTER($AI$2:$AI$100,$AH$2:$AH$100=AH2))
Worked perfectly. Thanks so much!!
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,539
Members
449,088
Latest member
RandomExceller01

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