Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default How can I handle duplicates in an Index function?

I want to use the VLOOKUP/MATCH/INDEX function to dynamically assign a
persons name to a record based on a zip code. I know how to do this but the
problem is that I can sometimes have in my table multiple people sharing a
zipcode and I was wondering if anyone has ever written a formula that would
cycle through the duplicates distributing out evenly amongst the people
sharing that zip.

Example:
37075 Smith
37078 Jones
38080 Brown
38080 Davis
38080 Daniels
38091 Owens

When the zip is 37075, I would want Smith assigned. When the zip is 38080,
I would want Brown assigned, then the next time I would want Davis assigned
to it, then the third time it would be Daniels. Then the assignments would
start over so that Brown would be assigned the fourth time that 38080 hits.

Does anyone know of a function within excel that would do this?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default How can I handle duplicates in an Index function?

One crack at this ...

Illustrated in this sample:
http://www.flypicture.com/download/NjI2MQ==
Assigning names to zips in cyclic criteria.xls

Assuming the zip codes for: Smith, Jones, Owens
are listed in F1 down

while those for: Brown, Davis, Daniels
are listed in G1 down

With source zips running in A1 down

Place in B1:
=IF(A1="","",IF(ISNUMBER(MATCH(A1,F:F,0)),INDEX({" Smith";"Jones";"Owens"},MOD(COUNTIF(A$1:A1,A1)-1,3)+1),IF(ISNUMBER(MATCH(A1,G:G,0)),INDEX({"Brown ";"Davis";"Daniels"},MOD(COUNTIF(A$1:A1,A1)-1,3)+1),"Check Zipcode")))

Copy B1 down as far as required. Adapt the "3" within the MOD to suit the
actual number of names to be cycled*.
*The indexed part within the curly braces: {"Smith";"Jones";" ... }
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"investor9987" wrote:
I want to use the VLOOKUP/MATCH/INDEX function to dynamically assign a
persons name to a record based on a zip code. I know how to do this but the
problem is that I can sometimes have in my table multiple people sharing a
zipcode and I was wondering if anyone has ever written a formula that would
cycle through the duplicates distributing out evenly amongst the people
sharing that zip.

Example:
37075 Smith
37078 Jones
38080 Brown
38080 Davis
38080 Daniels
38091 Owens

When the zip is 37075, I would want Smith assigned. When the zip is 38080,
I would want Brown assigned, then the next time I would want Davis assigned
to it, then the third time it would be Daniels. Then the assignments would
start over so that Brown would be assigned the fourth time that 38080 hits.

Does anyone know of a function within excel that would do this?

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
index,match - how to avoid same lookup when duplicates present nick Excel Worksheet Functions 12 April 9th 23 12:46 PM
Fill handle turned into a move handle Northwoods Excel Discussion (Misc queries) 1 March 2nd 07 03:40 PM
Can you change the function of the fill handle on a cell in Excel AndreaRaRa Excel Worksheet Functions 2 February 22nd 06 04:48 PM
How do you avoid duplicates when using the randbetween function? Monica Excel Worksheet Functions 2 February 16th 06 05:45 AM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM


All times are GMT +1. The time now is 10:01 AM.

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"