S
Stephen Dunn
Hi All,
Okay, forget about all the manual methods, as well as VBA and add-ins,
this is a CHALLENGE to build a single formula from standard functions.
At this point I have a formula that will extract and sort unique items
in one column. However, I can't seem to build in any form of criteria
based on other columns. It can be done in two formulae, but that's
missing the point.
Take the following example list (in A2:A12):
a
ab
15
BLANKCELL
2
d
aaaab
1
100
2
aaaac
With this formula (which, I must admit, I'm quite proud of):
=INDEX($A$2:$A$12,MATCH(ROWS($A$2:$A$12)-
SUM(COUNTIF($A$2:$A$12,C$1:C1))-COUNTBLANK($A$2:$A$12),
COUNTIF($A$2:$A$12,">="&$A$2:$A$12)+ISNUMBER($A$2:$A$12)*
SUM(--ISTEXT($A$2:$A$12)),0))
typed into C2 as an array formula and copied down to C12, we get this:
1
2
15
100
a
aaaab
aaaac
ab
d
0
0
I'm not worried about anything that comes after the desired list (0's,
errors, etc), that can all be cleared up later.
Curiously, the formula to sort the full list is a little bit longer, but
that's beside the point.
Now, the problem (that is costing me hair, and hours of social life) is
with a list such as:
d 1
c 2
b 3
a 1
a 2
b 3
c 1
d 2
d 3
c 1
b 2
(simplified - blanks and numbers must still be accounted for)
Pulling and sorting the unique values that have a 1 in the next column
should produce:
a
c
d
Even though I started this as a personal challenge, I'm running out of
ideas and need fresh thoughts. All suggestions (except rude ones <g>)
are welcome, remembering the boundaries of the challenge.
Anyone that can solve this one before I flip my lid will earn a night
out in Newcastle, England
Drinks and Club entrance only
Travel and Accomodation, etc at own cost...
(option to crash at my flat)
Regards,
Steve D.
p.s. this is from home (unusual for me recently) but it is me, and the
offer is genuine - I look forward to meeting any of the regulars,
however it doesn't exclude anyone else.
Okay, forget about all the manual methods, as well as VBA and add-ins,
this is a CHALLENGE to build a single formula from standard functions.
At this point I have a formula that will extract and sort unique items
in one column. However, I can't seem to build in any form of criteria
based on other columns. It can be done in two formulae, but that's
missing the point.
Take the following example list (in A2:A12):
a
ab
15
BLANKCELL
2
d
aaaab
1
100
2
aaaac
With this formula (which, I must admit, I'm quite proud of):
=INDEX($A$2:$A$12,MATCH(ROWS($A$2:$A$12)-
SUM(COUNTIF($A$2:$A$12,C$1:C1))-COUNTBLANK($A$2:$A$12),
COUNTIF($A$2:$A$12,">="&$A$2:$A$12)+ISNUMBER($A$2:$A$12)*
SUM(--ISTEXT($A$2:$A$12)),0))
typed into C2 as an array formula and copied down to C12, we get this:
1
2
15
100
a
aaaab
aaaac
ab
d
0
0
I'm not worried about anything that comes after the desired list (0's,
errors, etc), that can all be cleared up later.
Curiously, the formula to sort the full list is a little bit longer, but
that's beside the point.
Now, the problem (that is costing me hair, and hours of social life) is
with a list such as:
d 1
c 2
b 3
a 1
a 2
b 3
c 1
d 2
d 3
c 1
b 2
(simplified - blanks and numbers must still be accounted for)
Pulling and sorting the unique values that have a 1 in the next column
should produce:
a
c
d
Even though I started this as a personal challenge, I'm running out of
ideas and need fresh thoughts. All suggestions (except rude ones <g>)
are welcome, remembering the boundaries of the challenge.
Anyone that can solve this one before I flip my lid will earn a night
out in Newcastle, England
Drinks and Club entrance only
Travel and Accomodation, etc at own cost...
(option to crash at my flat)
Regards,
Steve D.
p.s. this is from home (unusual for me recently) but it is me, and the
offer is genuine - I look forward to meeting any of the regulars,
however it doesn't exclude anyone else.