Count like items and remove duplicates from list

artz

Well-known Member
Joined
Aug 11, 2002
Messages
830
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I have a large bill of materials for a printed circuit board in an Excel spreadsheet. Using the sort function, I was able to sort the columns based on part value; that got me part way of what I need.

What I still need however, is a macro or cell formula to do two things:

1) For a given value, provide count of like values and place count in column N
2) Remove the duplicate rows with the same values

The rows with duplicates should only removes rows in columns K, L, M, and N. (there are other active columns on the worksheet)

Below is a partial screenshot of the worksheet. The used range not including header rows is K6 - M6. This also doesn't include the count column range in column N.

Excel Workbook
KLMN
5ValueDigikey PNDescriptionCount
610P10.0HCT-NDRES 10.0 OHM 1/10W 1% 0603 SMD*
7511P511HCT-NDRES 511 OHM 1/10W 1% 0603 SMD*
8511P511HCT-NDRES 511 OHM 1/10W 1% 0603 SMD*
90.01uFPCC1750CT-NDCAP 10000PF 16V CERM X7R 0603*
100.01uFPCC1750CT-NDCAP 10000PF 16V CERM X7R 0603*
110.01uFPCC1750CT-NDCAP 10000PF 16V CERM X7R 0603*
120.01uFPCC1750CT-NDCAP 10000PF 16V CERM X7R 0603*
130.01uFPCC1750CT-NDCAP 10000PF 16V CERM X7R 0603*
140.01uFPCC1750CT-NDCAP 10000PF 16V CERM X7R 0603*
150.05 1WWSCB-50CT-NDRES 50 OHM 1W 1% 2515 WW SMD*
160.1F445-1317-1-NDCAP CER .10UF 16V X7R 10% 0603*
170.1F445-1317-1-NDCAP CER .10UF 16V X7R 10% 0603*
180.1F445-1317-1-NDCAP CER .10UF 16V X7R 10% 0603*
190.1F445-1317-1-NDCAP CER .10UF 16V X7R 10% 0603*
200.1F445-1317-1-NDCAP CER .10UF 16V X7R 10% 0603*
210.22uF445-1318-1-NDCAP CER .22UF 16V X7R 10% 0603*
221.5MegP1.50MHCT-NDRESISTOR 1.50M OHM 1/10W 1% 0603*
231.5MegP1.50MHCT-NDRESISTOR 1.50M OHM 1/10W 1% 0603*
241.5MegP1.50MHCT-NDRESISTOR 1.50M OHM 1/10W 1% 0603*
251000pF490-1494-1-NDCAP CER 1000PF 50V 10% X7R 0603*
261000pF490-1494-1-NDCAP CER 1000PF 50V 10% X7R 0603*
271000pF490-1494-1-NDCAP CER 1000PF 50V 10% X7R 0603*
28100KP100KHCT-NDRES 100K OHM 1/10W 1% 0603 SMD*
29100KP100KHCT-NDRES 100K OHM 1/10W 1% 0603 SMD*
30100KP100KHCT-NDRES 100K OHM 1/10W 1% 0603 SMD*
31100KP100KHCT-NDRES 100K OHM 1/10W 1% 0603 SMD*
32100KP100KHCT-NDRES 100K OHM 1/10W 1% 0603 SMD*
33100KP100KHCT-NDRES 100K OHM 1/10W 1% 0603 SMD*
34100KP100KHCT-NDRES 100K OHM 1/10W 1% 0603 SMD*
35100KP100KHCT-NDRES 100K OHM 1/10W 1% 0603 SMD*
36100K3214W-104ECT-NDTRIMPOT 100K OHM 4MM TOP ADJ SMD*
37100KP100KHCT-NDRES 100K OHM 1/10W 1% 0603 SMD*
38100KP100KHCT-NDRES 100K OHM 1/10W 1% 0603 SMD*
39100KP100KHCT-NDRES 100K OHM 1/10W 1% 0603 SMD*
40100KP100KHCT-NDRES 100K OHM 1/10W 1% 0603 SMD*
41100KP100KHCT-NDRES 100K OHM 1/10W 1% 0603 SMD*
PCB_BOM




Is anyone in the Forum able to offer some code to do this? Any help is greatly appreciated.

Thanks,

Art
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi Colin,

Except for having an extra column of data in column S, your worksheet does exactly what I need. Thanks so much. I can edit your macro to remove the extra data in column S.

As I mentioned this little routine will be very helpful going forward. :-)

Thanks Again,

Art
 
Upvote 0

Forum statistics

Threads
1,224,618
Messages
6,179,917
Members
452,949
Latest member
beartooth91

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