N
N
Nikita072020-07-30 21:41:12
Visual Basic
Nikita07, 2020-07-30 21:41:12

How to select duplicate values ​​in Excel?

Good evening, dear connoisseurs. The question arose, how to select duplicate values ​​in different columns with a macro, so that later you can work with data that is next to duplicates?
An example, there is such a table
5f23137b68979575309247.jpeg

How to use a macro to select the largest values, opposite to repeating values ​​(sorry for the tautology) i.e. against repeating 3 - 1000, against 7 - 2000, etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Grigory Boev, 2020-07-30
@Nikita07

If religion allows you to use Google spreadsheets, then there is this:
=МАКС(FILTER(B:B;A:A=A1))
If you need exactly Excel, then there is an algorithm like this:
1) Go through the lines. Put everything in a dictionary. First column: key, second: value. At the same time, you check if the key exists, then replace the value only if the current one is greater than the one already saved. After one pass, all that remains is to output the data from the dictionary to the array and put it in the range, or return it from the user function

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question