-2

I have a (long) list of Excel values with columns PartNo and Rev

I need to shrink my list down by deletion, leaving each PartNo and Rev at the highest Rev number.

Example of my data here
Example of my data here

This is what I want to end up with
What I want to end up with

There are 1500 rows that I'd like to do this on.

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
Nareik
  • 3
  • 5

2 Answers2

3

I suggest that you create a temporary helper column with this formula in it, copied down from row 2. Note that it is an array formula which must be confirmed with CTL+SHIFT+ENTER. The part number need not be in consecutive rows.

=MAX(IF($C$2:$C$100=$C2,$D$2:$D$100))

In my example C2:C100 is the range containing the part number and C2:D100 contains the Rev number. The formula will return the largest Rev number associated with C2. It will return the same Rev number for all rows of the same part number. Therefore you can use Excel's filter functionality to remove duplicates, leaving you with the desired result.

Variatus
  • 14,293
  • 2
  • 14
  • 30
2

Sort by column A (ascending) and column B (descending = highest value first) at the same time. So your data looks like:

enter image description here (note the Rev is going from maximum to minimum value now)

Then use the Remove Duplicates feature to remove duplicates in column A. So you end up with:

enter image description here

If you need to do this with VBA use the Macro Recorder (and do it manually while recording) to get a first idea of how your code could look like. After using the macro recorder you should read How to avoid using Select in Excel VBA before you continue.

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73