LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default find duplicates between rows, keep or delete entries based on ranked relevance

Hello all,

I am a biologist, I use Excel often but am new to VBA. Essentially, I
am looking to create a macro which gleans certain data from one
worksheet and refines and deposits it into an adjacent worksheet. If
the answer to my problem is already out there, sorry, I searched and
did not find it--probably I don't know enough on the topic to search
efficiently.

I have data classifying behavior of marked organisms. For a given date,
we may have recorded behavioral data on a unique animal more than once.
On some days I have 6 rows of data for a particular animal (identified
with an alphanumeric code, such as T332), and on some days I have only
one observation of that individual. Some behaviors are more
"important" than others, so if animal #T332 was recorded 6 times on
a given day I only need to keep the one row with the behavior deemed
most useful to our research question. Ultimately, I want one row of
data per animal per day. There are many hundreds of uniquely identified
organisms.

I'm trying to create a macro that will:

1. Search the worksheet, finding occurrences (rows) where the same
animal was observed more than once on the same date. E.g. if the fields
under columns: 'Name', 'Month', 'Day' and 'Year' are =
between 2 or more rows, I want to go to step 2.

2. Consider the group of rows which met the above criteria, the row
having the most "important" behavior (column 'rbi') observed on
that day is retained. Other rows are discarded. rbi order of importance
(high priority to low) is: S, NP, WP, WF, OM, A, U.

3. The "winning" row is sent to an adjacent results worksheet.

When there aren't multiple rows per animal per date, the program
sends the lone entry to the results worksheet, and the program goes on
to search the entire worksheet.

I'm turning to this forum because I haven't found much discussion
or information (that I understand at least) online or in the books
which I could use to do this. Any ideas would be great, if possible,
please include as many translations from code language to English as
you can. Even just help on coding out the first step would be
incredibly helpful-i.e. how to find and select rows that have the
same values under certain columns.

Any Ideas? Thanks for taking the time to think about this!

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find Duplicates Across Two Sheets, Delete Everything else. waggett Excel Worksheet Functions 2 October 6th 09 02:01 PM
find & delete rows based on text deb Excel Discussion (Misc queries) 4 September 17th 08 01:02 AM
Find Duplicates Rows Based Own Multiple Columns Cue Excel Discussion (Misc queries) 2 June 20th 08 11:43 PM
How to delete duplicates based on data in 2 columns? Max Excel Discussion (Misc queries) 2 April 9th 08 04:46 PM
find and delete duplicate entries in two columns or find and prin. campare 2 columns of numbers-find unique Excel Programming 1 November 24th 04 04:09 PM


All times are GMT +1. The time now is 03:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"