Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 24
Default Compare adjacent fields in adjacent rows

I need to flag duplicate names in a spread sheet sorted by Surname,
Given Name (separate columns).

In other words...

IF (the surname and the given name in row(n) match the surname and given
name in the row above(n-1) or below(n+1), display "Dupe", else display "
" )

Thank you for your help.

Joan


  #2   Report Post  
Posted to microsoft.public.excel.newusers
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Compare adjacent fields in adjacent rows

Assuming the 2 source cols are cols B and C, data in row 2 down
Put this in D2:
=IF(COUNTA(B2:C2)=0,"",IF(SUMPRODUCT((B$2:B2=B2)*( C$2:C2=C2))1,"dupe",""))
Copy down to the last row of source data
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Quimera" wrote in message
news:thl%j.317$i74.205@edtnps91...
I need to flag duplicate names in a spread sheet sorted by Surname, Given
Name (separate columns).

In other words...

IF (the surname and the given name in row(n) match the surname and given
name in the row above(n-1) or below(n+1), display "Dupe", else display "
" )

Thank you for your help.

Joan



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 24
Default Compare adjacent fields in adjacent rows

Sorry, that didn't seem to work. The comparison fields are text fields,
not number fields. Would that make a difference?

Thanks.

"Max" wrote in message
...
Assuming the 2 source cols are cols B and C, data in row 2 down
Put this in D2:
=IF(COUNTA(B2:C2)=0,"",IF(SUMPRODUCT((B$2:B2=B2)*( C$2:C2=C2))1,"dupe",""))
Copy down to the last row of source data
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Quimera" wrote in message
news:thl%j.317$i74.205@edtnps91...
I need to flag duplicate names in a spread sheet sorted by Surname,
Given Name (separate columns).

In other words...

IF (the surname and the given name in row(n) match the surname and
given name in the row above(n-1) or below(n+1), display "Dupe", else
display " " )

Thank you for your help.

Joan





  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 24
Default Compare adjacent fields in adjacent rows

My apologies - it does work for the row AFTER a duplicate but I also
need to show a duplicate BEFORE a row. i.e. when there are 3 or more
duplicate rows they should all show "Dupe".

Thanks


"Quimera" wrote in message
news:P_s%j.404$i74.309@edtnps91...
Sorry, that didn't seem to work. The comparison fields are text
fields, not number fields. Would that make a difference?

Thanks.

"Max" wrote in message
...
Assuming the 2 source cols are cols B and C, data in row 2 down
Put this in D2:
=IF(COUNTA(B2:C2)=0,"",IF(SUMPRODUCT((B$2:B2=B2)*( C$2:C2=C2))1,"dupe",""))
Copy down to the last row of source data
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Quimera" wrote in message
news:thl%j.317$i74.205@edtnps91...
I need to flag duplicate names in a spread sheet sorted by Surname,
Given Name (separate columns).

In other words...

IF (the surname and the given name in row(n) match the surname and
given name in the row above(n-1) or below(n+1), display "Dupe", else
display " " )

Thank you for your help.

Joan







  #5   Report Post  
Posted to microsoft.public.excel.newusers
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Compare adjacent fields in adjacent rows

Use this revised one instead, in D2:
=IF(COUNTA(B2:C2)=0,"",IF(SUMPRODUCT((B$2:B$200=B2 )*(C$2:C$200=C2))1,"dupe",""))
Copy down. Adapt the fixed ranges to suit the extent of your actual data:
B$2:B$200, C$2:C$200
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Quimera" wrote in message
news:kmt%j.407$i74.332@edtnps91...
My apologies - it does work for the row AFTER a duplicate but I also need
to show a duplicate BEFORE a row. i.e. when there are 3 or more duplicate
rows they should all show "Dupe".

Thanks





  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 24
Default Compare adjacent fields in adjacent rows

Hi Max,

Yes!!! Works beautifully. Many thanks indeed.

Joan

"Max" wrote in message
...
Use this revised one instead, in D2:
=IF(COUNTA(B2:C2)=0,"",IF(SUMPRODUCT((B$2:B$200=B2 )*(C$2:C$200=C2))1,"dupe",""))
Copy down. Adapt the fixed ranges to suit the extent of your actual
data: B$2:B$200, C$2:C$200
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Quimera" wrote in message
news:kmt%j.407$i74.332@edtnps91...
My apologies - it does work for the row AFTER a duplicate but I also
need to show a duplicate BEFORE a row. i.e. when there are 3 or more
duplicate rows they should all show "Dupe".

Thanks





  #7   Report Post  
Posted to microsoft.public.excel.newusers
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Compare adjacent fields in adjacent rows

Welcome, Joan
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Quimera" wrote in message
news:joD%j.445$cV.139@edtnps92...
Hi Max,

Yes!!! Works beautifully. Many thanks indeed.

Joan



Reply
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
compare two text and if equal copy adjacent data Prashanthom Excel Worksheet Functions 1 December 29th 06 03:03 AM
When data match, copy adjacent value to adjacent column slimbim Excel Worksheet Functions 2 November 8th 06 08:41 PM
compare adjacent cells and calculate averages Marquismarce Excel Worksheet Functions 5 May 17th 06 09:46 AM
summing values from adjacent column with refrence from adjacent column Pivotrend Excel Discussion (Misc queries) 6 March 4th 06 11:24 AM
compare contents of two adjacent columns Adam Excel Worksheet Functions 6 August 8th 05 09:06 PM


All times are GMT +1. The time now is 06:38 PM.

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

About Us

"It's about Microsoft Excel"