Jan 2007 Challenge of the Month Discussion

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi, Bill!

I see you're looking for the "best non-VBA solution", but does "non-VBA" also exclude using the morefunc.dll add-in everyone should have?

Seems that something like

H2: {=SUBSTITUTE(MCONCAT(SMALL(IF(INT($A$2:$E$6/10)=G2,MOD($A$2:$E$6,10)),ROW(INDIRECT("1:"&SUMPRODUCT(--(INT($A$2:$E$6/10)=G2)))))),"FALSE","")} copied down would work...
 
I would say using MoreFunc.dll is valid, although if someone does it without MoreFunc.dll, then this would be more elegant...
 
H2=REPT(0,COUNTIF(A$8:A$32,G2*10)) &SUBSTITUTE( SUMPRODUCT(ROW($1:$9)*(10^COUNTIF(A$8:A$32,G2*10+ROW($1:$9))-1)*10^(COUNTIF(A$8:A$32,">"& G2*10+ROW($1:$9))-COUNTIF(A$8:A$32,">"& G2*10+10))/9),0,"")

Drop it down to H6
 
Another:
H2=REPT(0,COUNTIF(A$8:A$32,G2*10)) & SUMPRODUCT(ROW($1:$9)*(10^COUNTIF(A$8:A$32,G2*10+ROW($1:$9))-1)*10^(COUNTIF(A$8:A$32,">"&G2*10+ROW($1:$9))+MATCH(G2*10+9,A$8:A$32)-26)/9)

Drop it down to H6
 
Here is a asolution that works on the original grid. It does put the results into separate cells, so it has to be copied across however many cells that there are in the grid (a use for Excel 2007?)

=IF(ISERROR(INT(SMALL(IF($A$2:$E$6-MOD($A$2:$E$6,10)=$G2*10,MOD($A$2:$E$6,10)*10^5+ROW($A$2:$E$6)*10^2+COLUMN($A$2:$E$6),""),COLUMN(A$1))/10^5)),"",
INT(SMALL(IF($A$2:$E$6-MOD($A$2:$E$6,10)=$G2*10,MOD($A$2:$E$6,10)*10^5+ROW($A$2:$E$6)*10^2+COLUMN($A$2:$E$6),""),COLUMN(A$1))/10^5))

of course it is an array formula.
 
It can be reduced to

=INT(SMALL(IF($A$2:$E$6-MOD($A$2:$E$6,10)=$G2*10,MOD($A$2:$E$6,10)*10^5+ROW($A$2:$E$6)*10^2+COLUMN($A$2:$E$6),""),COLUMN(A$1))/10^5)

and use conditional formatting to hide the errors.
 
Hi, Bill!

I see you're looking for the "best non-VBA solution", but does "non-VBA" also exclude using the morefunc.dll add-in everyone should have?

Seems that something like

H2: {=SUBSTITUTE(MCONCAT(SMALL(IF(INT($A$2:$E$6/10)=G2,MOD($A$2:$E$6,10)),ROW(INDIRECT("1:"&SUMPRODUCT(--(INT($A$2:$E$6/10)=G2)))))),"FALSE","")} copied down would work...

Furthermore using morefunc.dll then this can be rewritten as:

H2: {=MCONCAT(REPT(ROW($1:$10)-1,COUNTIF(A$8:A$32,G2*10+ROW($1:$10)-1)))}

I'm trying to think of a way using pivot tables but no luck thus far.
Regards,
Mark
 
H2=REPT(0,COUNTIF(A$8:A$32,G2*10))& SUMPRODUCT(ROW($1:$9)*INT(10^COUNTIF(A$8:A$32,G2*10+ROW($1:$9))/9)*10^(COUNTIF(A$8:A$32,">"&G2*10+ROW($1:$9))+MATCH(G2*10+9,A$8:A$32)-25))
 

Forum statistics

Threads
1,222,716
Messages
6,167,823
Members
452,146
Latest member
Baldred

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top