jeffreyweir
Active Member
Formula Challenge 017 – Conditional Unique Nth Value
Challenge description
Write a formula that displays the nth largest unique number from the Data column for items in the Item column that match the currently selected Lookup Item.
Challenge setup
Put the following data in A1:B13
[pre]
[/pre]
Assign the name 'n' to the range D2
Assign the name 'l' to the E2
If successful, your formula results will match the below table:
Item N = 1 N = 2 N = 3 N = 4 N = 5
Cat 662100 11287 9439 3090 0
Apple 662100 9439 3090 0 0[/code][/pre]
Rules
* No whole column references
* No intermediate formulas
* No VBA
* The formula should work no matter where the source data is shifted in the worksheet. So no hard-coded references other than the named ranges i,d,n, and l
My formula length: 56 characters.
Challenge description
Write a formula that displays the nth largest unique number from the Data column for items in the Item column that match the currently selected Lookup Item.
Challenge setup
Put the following data in A1:B13
[pre]
Code:
Item (i) Data (d)
Cat 662100
Cat 11287
Cat 11287
Apple 9439
Apple 3090
Cat 3090
Apple 662100
Cat 11287
Cat 11287
Cat 9439
Apple 3090
Cat 3090
Assign the name 'i' to the range A1:A13
Assign the name 'd' to the range B1:B13
Put the following data in D1:E2
[pre][code]Nbr(n): Lookup(l):
3 Cat
Assign the name 'n' to the range D2
Assign the name 'l' to the E2
If successful, your formula results will match the below table:
Item N = 1 N = 2 N = 3 N = 4 N = 5
Cat 662100 11287 9439 3090 0
Apple 662100 9439 3090 0 0[/code][/pre]
Rules
* No whole column references
* No intermediate formulas
* No VBA
* The formula should work no matter where the source data is shifted in the worksheet. So no hard-coded references other than the named ranges i,d,n, and l
My formula length: 56 characters.