Macro to copy top 3 value in column

I

ixara

Dear all,

I've columnA(code), columnB(desc) and columnC(value) in sheet1. How ca
i copy top 3 highest value for each desc into sheet2?..Below is th
illustration of the scenario. Thanks in advance for any help.

Sheet1
ColumnA ColumnB ColumnC
abc123 item1 5987
def312 item1 2324
ert343 item1 424
pty325 item1 342
ade234 item2 1234
ert355 item2 987
rey299 item2 873
trey244 item2 444
retrt345 item2 434

sheet2
ColumnA ColumnB ColumnC
abc123 item1 5987
def312 item1 2324
ert343 item1 424
ade234 item2 1234
ert355 item2 987
rey299 item2 87
 
B

Ben McClave

Good Evening,

This is more of a manual process, but you could automate it with a macro. If you have a blank column next to your data, enter this formula to Rank the values using conditions (assumes data is in the range A1:B10 with a header row):

=1+SUMPRODUCT(($B$2:$B$10=B2)*($C$2:$C$10>C2))

Now that you have a rank for each type of value in column B, you can either filter or use Advanced Filter to find the values you want to copy/paste.

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top