Return non-unique values within a cell

bksbksbks

New Member
Joined
Nov 18, 2024
Messages
12
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
  3. Web
The program creating my assignment groupings has an any/all option - either match any of the criteria (these jobs or any of these companies) or match all of them (these jobs only within these companies). I have been able to get the information to almost be where I need it to be - I have gotten far enough that if a job appears in my included job list (row 4 below) more than once, I know it meets all of the criteria and thus should appear in the final list of included jobs (rows 6+). There are occasionally excluded job roles, such as B5.

Book1
ABC
1Assignment GroupGroup1Group2
2Assigned CourseDispensing Propane SafelyDispensing Propane Safely
3Any/AllAllAny
4IncludesCUST MAINT MGR|TC HOUSEKEEPER|CUSTODIAL SUPER|TC SALES ASSOCIATE|TC DELI CLERK|CUST MAINT MGR|TC OFFICE ASSISTANT|TC ASSOCIATE MERCHANDISER|TC STORE SUPER|TC MGR|TC PARTS MANAGER HRLY|TC AST MGR|MAINTENANCE ASSOCIATE|STORE ASSOC UNDER 19|TC DELI CLERK UNDER 18|TC STOCK ASSOC UNDER 19|TC FC ASSOC UNDER 18CUST MAINT MGR|TC HOUSEKEEPER|CUSTODIAL SUPER|TC SALES ASSOCIATE|TC DELI CLERK|CUST MAINT MGR|TC OFFICE ASSISTANT|TC ASSOCIATE MERCHANDISER|TC STORE SUPER|TC MGR|TC PARTS MANAGER HRLY|TC AST MGR|MAINTENANCE ASSOCIATE|STORE ASSOC UNDER 19|TC DELI CLERK UNDER 18|TC STOCK ASSOC UNDER 19|TC FC ASSOC UNDER 18
5ExcludesTC AST MGR
6All Included JobsCUST MAINT MGRCUST MAINT MGR
7CUSTODIAL SUPER
8MAINTENANCE ASSOCIATE
9STORE ASSOC UNDER 19
10TC ASSOCIATE MERCHANDISER
11TC DELI CLERK
12TC DELI CLERK UNDER 18
13TC FC ASSOC UNDER 18
14TC HOUSEKEEPER
15TC MGR
16TC OFFICE ASSISTANT
17TC PARTS MANAGER HRLY
18TC SALES ASSOCIATE
19TC STOCK ASSOC UNDER 19
20TC STORE SUPER
Sheet1


How can I find those duplicated jobs within C4?

Current sample formula in row 6 (with many thanks to Fluff!):
Excel Formula:
=IFERROR(TRANSPOSE(SORT(UNIQUE(TEXTSPLIT(TEXTJOIN("|",,IF(AC6<>"",LET(a,TEXTSPLIT(AC4,"|"),TEXTJOIN("|",,FILTER(a,ISNA(XMATCH(a,TEXTSPLIT(AC6,"|")))))),AC4)),"|"),TRUE),,,TRUE)),"")
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Is this what you mean?

AB
1
2
3
4IncludesAA|BB|CC|DD|AA|DD|EE|EE
5ExcludesBB|CC|DD
6Result?AA
7EE
8
Sheet1
Cell Formulas
RangeFormula
B6:B7B6=LET(inc,TEXTSPLIT(B4,,"|"),UNIQUE(FILTER(inc,1<BYROW(inc,LAMBDA(r,SUM((inc=r)*IF(B5="",1,ISNA(MATCH(r,TEXTSPLIT(B5,,"|"),)))))))))
Dynamic array formulas.
 
Upvote 1
Solution
Is this what you mean?

AB
1
2
3
4IncludesAA|BB|CC|DD|AA|DD|EE|EE
5ExcludesBB|CC|DD
6Result?AA
7EE
8
Sheet1
Cell Formulas
RangeFormula
B6:B7B6=LET(inc,TEXTSPLIT(B4,,"|"),UNIQUE(FILTER(inc,1<BYROW(inc,LAMBDA(r,SUM((inc=r)*IF(B5="",1,ISNA(MATCH(r,TEXTSPLIT(B5,,"|"),)))))))))
Dynamic array formulas.
I want to say yes. When I ran the formula in my initial cell it worked great. When I copied it to other cells on the sheet it made Excel explode, so I'm going to hope for the best :ROFLMAO:

It amazes me with all I have learned about Excel that there are still so many advanced formula features that are out of my grasp. Thanks for your help!
 
Upvote 0
Maybe:
=UNIQUE(TOCOL(LET(f,TEXTSPLIT(B4,"|"),FILTER(f,ISNA(XMATCH(f,TEXTSPLIT(B5,"|"),0))))))
 
Upvote 0
Maybe:
=UNIQUE(TOCOL(LET(f,TEXTSPLIT(B4,"|"),FILTER(f,ISNA(XMATCH(f,TEXTSPLIT(B5,"|"),0))))))
The question wasn't totally clear, but I interpreted as all items appearing more than once in B4, and not in B5.

Hence for example:
AB
1
2
3
4IncludesAA|AA|BB|BB|CC|DD
5ExcludesBB
6Result?AA
Sheet1
Cell Formulas
RangeFormula
B6B6=LET(inc,TEXTSPLIT(B4,,"|"),UNIQUE(FILTER(inc,1<BYROW(inc,LAMBDA(r,SUM((inc=r)*IF(B5="",1,ISNA(MATCH(r,TEXTSPLIT(B5,,"|"),)))))))))
 
Upvote 0
I really do value you all of your suggestions. I have tried implementing them and have come to the realization that I may need to rethink my approach to this particular task. I hope to have an update soon!
 
Upvote 0

Forum statistics

Threads
1,224,749
Messages
6,180,730
Members
452,995
Latest member
isldboy

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