Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Vlookup to cope with duplicates

Hi,

This ARRAY formula returns the Nth match. Put your lookup value in e1 and
the number of the match you want in F1 (i.e. 2 for the second match). See
below for how to enter an ARRAY formula.

=INDEX(B1:B20,LARGE((A1:A20=E1)*ROW(A1:A20),COUNTI F(A1:A20,E1)+1-F1))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"KayeNightingale" wrote:

We have a list of Books; each Book has a Unique ISBN Number but,
unfortunately the same Book can be listed twice so we are struggling to write
a suitable VLOOKUP formula.

The VLOOKUP correctly finds the first occurence of an entry with that ISBN
number but how can we deal with finding the next occurence of the same ISBN
number?

There are 5000 rows of data and a lot of duplicates so this is causing a
huge amount of manual editing each Quarter.

Can anyone else please?
KayeNightingale

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Vlookup to cope with duplicates

Hi Mike

Thank you so much; I have just tried this on a dummy spreadsheet and it
works a treat! I'm off to test it on the real data.

Thanks again!
Regards
Kaye


"Mike H" wrote:

Hi,

This ARRAY formula returns the Nth match. Put your lookup value in e1 and
the number of the match you want in F1 (i.e. 2 for the second match). See
below for how to enter an ARRAY formula.

=INDEX(B1:B20,LARGE((A1:A20=E1)*ROW(A1:A20),COUNTI F(A1:A20,E1)+1-F1))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"KayeNightingale" wrote:

We have a list of Books; each Book has a Unique ISBN Number but,
unfortunately the same Book can be listed twice so we are struggling to write
a suitable VLOOKUP formula.

The VLOOKUP correctly finds the first occurence of an entry with that ISBN
number but how can we deal with finding the next occurence of the same ISBN
number?

There are 5000 rows of data and a lot of duplicates so this is causing a
huge amount of manual editing each Quarter.

Can anyone else please?
KayeNightingale

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Vlookup to cope with duplicates

Glad I could help

"KayeNightingale" wrote:

Hi Mike

Thank you so much; I have just tried this on a dummy spreadsheet and it
works a treat! I'm off to test it on the real data.

Thanks again!
Regards
Kaye


"Mike H" wrote:

Hi,

This ARRAY formula returns the Nth match. Put your lookup value in e1 and
the number of the match you want in F1 (i.e. 2 for the second match). See
below for how to enter an ARRAY formula.

=INDEX(B1:B20,LARGE((A1:A20=E1)*ROW(A1:A20),COUNTI F(A1:A20,E1)+1-F1))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"KayeNightingale" wrote:

We have a list of Books; each Book has a Unique ISBN Number but,
unfortunately the same Book can be listed twice so we are struggling to write
a suitable VLOOKUP formula.

The VLOOKUP correctly finds the first occurence of an entry with that ISBN
number but how can we deal with finding the next occurence of the same ISBN
number?

There are 5000 rows of data and a lot of duplicates so this is causing a
huge amount of manual editing each Quarter.

Can anyone else please?
KayeNightingale

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
Condensing a list with duplicates to a list with non-duplicates Nuclear Excel Worksheet Functions 2 July 29th 08 08:03 PM
Duplicates in excel that aren't 100% DUPLICATES ... [email protected] Excel Discussion (Misc queries) 4 May 2nd 08 06:43 PM
Cope cells Roog Excel Discussion (Misc queries) 3 February 8th 07 06:33 PM
Is there a way MATCH() can cope with duplicate values? JimmyQ Excel Worksheet Functions 3 August 9th 06 11:25 PM
Duplicates - not all the same blander Excel Discussion (Misc queries) 1 July 28th 06 01:44 PM


All times are GMT +1. The time now is 09:47 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"