How to effectively subtract one unique list from another?

DigitalZugzwang

New Member
Joined
Jul 27, 2017
Messages
20
Hi Everyone!

So I've got an issue that I can't seem to find a solution for. What I need is to generate a cell that shows the Open Jobs (non-closed). With TextJoin function I can put them all in the same cell, however I'm struggling to generate the unique list because I need to remove Closed Jobs. I can make a unique list of Started Jobs and Closed Jobs (using uniquevalues function from morefunc). Unfortunately, I can't seem to subtract one from the other...so to speak.

Below we have a table showing how we track our Work In Progress (WIP). As you can see each Job has a unique number and multiple activities. How do we make a list of the Started Jobs and remove the Closed Jobs? Also, I don't think using the advanced filter is an option as I need this to update as users populate the status of jobs. VBA is an option but because of other code being used, it could very well act funky.

Thank you very much in advance.

Job NumberActivity
1Start Job
1WIP
1Close Job
2Start Job
2WIP
3Start Job
4Start Job
3WIP

<tbody>
</tbody>
 
Last edited:

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Should I assume because there have been no replies that there is no good way to compare two groups of distinct values to generate a list where there are differences? To accomplish a list of WIP do I need to rework the logic of the entire sheet?
 
Upvote 0
Maybe...


A
B
C
D
1
Job Number​
Activity​
Result​
2
1​
Start Job​
2, 3, 4​
3
1​
WIP​
4
1​
Close Job​
5
2​
Start Job​
6
2​
WIP​
7
3​
Start Job​
8
4​
Start Job​
9
3​
WIP​

Array formula in D2
=TEXTJOIN(", ",1,IF(FREQUENCY(A2:A9,A2:A9),IF(ISNA(MATCH(A2:A9,IF(B2:B9="Close Job",A2:A9),0)),A2:A9,""),""))
Ctrl+Shift+Enter

M.
 
Upvote 0
The output for the above table should be 2, 3, 4 as Marcelo has it in his table because only Job Number 1 is closed. When I attempt Marcelo's formula, it lists the jobs completed along with every instance of the job number as well as leaving blanks for the ones removed. So for the above example it looks like:

1, 1, 1, , , , , , ,

Now the above result occurs when I do this as an array. If I do it as a normal formula, it simply lists every job number one time. I believe part of the issue is that every job number will have 1 Start, 1 or more WIP, and eventually 1 Close statuses. So when we search the Job numbers one row might show Close but other rows will have different statuses.

This does feel like a good start. Would it matter that I'm using table references (e.g. WIPtrack[job]) rather than A2:A9?

Thank you
 
Last edited:
Upvote 0
The output for the above table should be 2, 3, 4 as Marcelo has it in his table because only Job Number 1 is closed. When I attempt Marcelo's formula, it lists the jobs completed along with every instance of the job number as well as leaving blanks for the ones removed.

It's an array formula. Have you confirmed the formula with Ctrl+Shift+Enter simultaneously (not just Enter)?

M.
 
Upvote 0
Using structerd references (table references)

Array formula
=TEXTJOIN(", ",1,IF(FREQUENCY(WIPtrack[Job Number],WIPtrack[Job Number]),IF(ISNA(MATCH(WIPtrack[Job Number],IF(WIPtrack[Activity]="Close Job",WIPtrack[Job Number]),0)),WIPtrack[Job Number],""),""))
Ctrl+Shift+Enter

M.
 
Upvote 0
Marcelo Thank You!!!!

I miss-typed one of my ranges from your original formula and that is why it wasn't working. This is perfect!
 
Upvote 0

Forum statistics

Threads
1,214,972
Messages
6,122,530
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