Jared
Jared

Reputation: 67

Compare text data in column for duplicate and get value from different column

I have a list that I will be updating daily with new records (rows) of data. I need to have the spreadsheet locate duplicates from a column and, if found, copy a cell from the duplicate row and place it in the duplicated row.

Let's say there are 3 columns, column A has a description, column B has a number, column C is the original number. I need to check for duplicates from column A. If a duplicate is found in Column A, I need the number found in column B from the duplicate row copied to the later (duplicated) record in column C.

Example:

Description    Number    Original Number 

2/27/2014       
somedata       123  
otherdata      456  

2/28/2014       
newdata        789  
somedata       523       123
othernewdata   679


I know I can use the conditional formatting to highlight cells but is there a way to have it copy data from a cell above to a new cell if a duplicate is found?

Upvotes: 0

Views: 1844

Answers (1)

nagyben
nagyben

Reputation: 938

This will only work if the duplicate data is above the new data. If you have multiple "duplicates", then it will always return the first instance of it in the spreadsheet.

=IF(VLOOKUP(A2,A:B,2,FALSE)=B2,"",VLOOKUP(A2,A:B,2,FALSE))

enter image description here

Upvotes: 1

Related Questions