Vlookup, duplicate and unique value help

cgendron

Board Regular
Joined
Apr 13, 2011
Messages
111
Hey all,
I have two columns, A and B. Column A has certain words pertaining to codes, column B has the codes.
ChangeCode
Deleted10021
Added10022
10060
Deleted10061
10120
10140
Deleted10180
11055
11100

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>

I'm using a vlookup to find any code with the word "deleted" next to it. The obvious problem i have is it only bring in the first instance. How do i ignore the duplicates and only bring in the unique code instance? i have a summary column for all the deleted and added ones. I want all the deleted codes under the deleted column and added codes under the added column.

DeletedAdded
J172590651
J1725
J1725
J1725
J1725
J1725
J1725

<colgroup><col><col></colgroup><tbody>
</tbody>


Thanks in advance!
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Select both columns (the one containing the code and the one containing the status-deleted or added), go to the data tab then click remove duplicates and check that both columns selected then press OK.

Copy and paste the unique codes on the same row to the right of the ones you have just removed (so codes are in column a1 down, statuses in b1 down, copy the now unique codes from column a1 down to d1 down, then you can have e1 down as added column and f1 down as deleted) Then you could just use an if function in the deleted and added column which looks up to the current status column and codes column, as below:

added column -e:
=if(b1="added","added","")

deleted column -f:
=if(b1="deleted",deleted","")

Hope this helps :)
 
Last edited:
Upvote 0
Select both columns (the one containing the code and the one containing the status-deleted or added), go to the data tab then click remove duplicates and check that both columns selected then press OK.

Copy and paste the unique codes on the same row to the right of the ones you have just removed (so codes are in column a1 down, statuses in b1 down, copy the now unique codes from column a1 down to d1 down, then you can have e1 down as added column and f1 down as deleted) Then you could just use an if function in the deleted and added column which looks up to the current status column and codes column, as below:

added column -e:
=if(b1="added","added","")

deleted column -f:
=if(b1="deleted",deleted","")

Hope this helps :)


Thanks for the reply. I'm looking to do this automatically with a formula. I've done it in the past but can't remember the formula to ignore dups and only grab the unique values
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,956
Members
449,200
Latest member
indiansth

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