Formula or Function to pull from Column B and populate Column C

SOLTEC

Board Regular
Joined
Feb 11, 2015
Messages
195
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Thank you in advance for any and all assistance. It is so greatly appreciated. I need to match Column A with all matches in Column B and populate Column C with that data, similar to the example. There are sometimes one item match and other times multiple. The first 5 alpha characters are the match criteria. Example: F4506. None of the Column A are more than 5 alpha characters.


Excel 2010
ABC
1Product IDProduct Image(s)All Product Images for Product ID
2F4506F126739347.jpg4506.jpg;F4506BACK.jpg;F4506SOLE.jpg
3F4506F126839347.jpg
4F4506F146739270.jpg
5F4506F146739347.jpg
6F4506F146839270.jpg
7F4506F146839347.jpg
8F4506F4506.jpg
9F4506F4506BACK.jpg
10F4506F4506SOLE.jpg
11F4506F4507.jpg
12F4506F4507BACK.jpg
13F4506F4507SOLE.jpg
14F4506F4508.jpg
15F4506F4508BACK.jpg
16F4506F4508SOLE.jpg
17F4506F4509.jpg
18F4506F4509BACK.jpg
19F4506F4509SOLE.jpg
20F4506F4510.jpg
21F4506F4510BACK.jpg
22F4506F4510SOLE.jpg
23F4506F4511.jpg
24F4506F4511BACK.jpg
25F4506F4511SOLE.jpg
26F4506F4512.jpg
27F4506F4512BACK.jpg
28F4506F4512SOLE.jpg
29F4506F4514.jpg
30F4506F4514BACK.jpg
31F4506F4514SOLE.jpg
32F4506F511546001
33F4506F511546001.jpg
34F4506F511546221.jpg
35F4506F511546388.jpg
36F4506F520112001.jpg
37F4506F520112250.jpg
38F4506F520112320.jpg
39F4507F520112330.jpg
Sheet3
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Thank you in advance for any and all assistance. It is so greatly appreciated. I need to match Column A with all matches in Column B and populate Column C with that data, similar to the example. There are sometimes one item match and other times multiple. The first 5 alpha characters are the match criteria. Example: F4506. None of the Column A are more than 5 alpha characters.
.....


Hi SOLTEC
. Hope your Health is holding out…. And good to see you mastered the Forum Tools…..
(…. Post # 31…
http://www.mrexcel.com/forum/excel-questions/837991-excel-forum-software-4.html#post4084259
…….. )

… Any ways, The requirement you have here, I think lends itself nicely to some Formula, Functions and Codes discussed in some detail Here:-

http://www.mrexcel.com/forum/excel-questions/818208-code-move-vertical-horizontal-4.html

… As an example I made a start at the Formula variant applied to your case… I will not go into too boring long detail here as I did the stuff back in January and after an “occurrence” in the meantime it is probably a close thing which of us is the sharpest Tool in the shed just now…….But I did make some effort back in that Thread explaining very clearly and colorfully the Theory and breaking down the stuff, some of which I repeat again here applied to your data.

… For example , the last variation in that Thread involves a Formula which by a first tweaking of I can obtain Results of this form for your data: (The output of interest to you if G here, corresponding to F in the other Thread (Everything is shifted a column over compared with that thread due to the extra bit of getting a help Column for the first 5 characters from your Product image(s) Entry. ( In fact to get my formula to work I needed copy the entire Product Image(s) Entry for the appropriate match condition, and stick an arbitrary “Nothing” entry ( Jack Sh#t” I chose ) for the no match case ) ) … But that is the nitty gritty detail you will only appreciate if you can follow the formula working in detail ) )


Using Excel 2007
[Table="width:, class:grid"][tr][td]-[/td][td]
A
[/td][td]
B
[/td][td]
C
[/td][td]
D
[/td][td]
E
[/td][td]
F
[/td][td]
G
[/td][/tr]
[tr][td]
1
[/td][td][/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][td]
E​
[/td][td]
F​
[/td][/tr]

[tr][td]
2
[/td][td]Product Image(s)[/td][td]
NUMBER​
[/td][td]
[/td][td]
Unique Numbers​
[/td][td]
[/td][td]
[/td][td]
[/td][/tr]

[tr][td]
3
[/td][td]F126739347.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
F4506​
[/td][td]JackS__t / JackS__t / JackS__t / JackS__t / JackS__t / F4506.jpg / F4506BACK.jpg / F4506SOLE.jpg / JackS__t[/td][td] F4506.jpg / F4506BACK.jpg / F4506SOLE.jpg / [/td][td] F4506.jpg / F4506BACK.jpg / F4506SOLE.jpg / [/td][/tr]

[tr][td]
4
[/td][td]F126839347.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
F4507​
[/td][td] / / / / / / / / [/td][td][/td][td]F450712330.jpg[/td][/tr]

[tr][td]
5
[/td][td]F146739270.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
6
[/td][td]F146739347.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
7
[/td][td]F146839270.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
8
[/td][td]F146839347.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
9
[/td][td]F4506.jpg[/td][td]F4506[/td][td]
F4506.jpg​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
10
[/td][td]F4506BACK.jpg[/td][td]F4506[/td][td]
F4506BACK.jpg​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
11
[/td][td]F4506SOLE.jpg[/td][td]F4506[/td][td]
F4506SOLE.jpg​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
12
[/td][td]F4507.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
13
[/td][td]F4507BACK.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
14
[/td][td]F4507SOLE.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
15
[/td][td]F4508.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
16
[/td][td]F4508BACK.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
17
[/td][td]F4508SOLE.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
18
[/td][td]F4509.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
19
[/td][td]F4509BACK.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
20
[/td][td]F4509SOLE.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
21
[/td][td]F4510.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
22
[/td][td]F4510BACK.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
23
[/td][td]F4510SOLE.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
24
[/td][td]F4511.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
25
[/td][td]F4511BACK.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
26
[/td][td]F4511SOLE.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
27
[/td][td]F4512.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
28
[/td][td]F4512BACK.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
29
[/td][td]F4512SOLE.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
30
[/td][td]F4514.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
31
[/td][td]F4514BACK.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
32
[/td][td]F4514SOLE.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
33
[/td][td]F511546001[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
34
[/td][td]F511546001.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
35
[/td][td]F511546221.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
36
[/td][td]F511546388.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
37
[/td][td]F520112001.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
38
[/td][td]F520112250.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
39
[/td][td]F520112320.jpg[/td][td]F4506[/td][td]
JackS__t​
[/td][td]
[/td][td] / / / / / / / / [/td][td][/td][td][/td][/tr]

[tr][td]
40
[/td][td]F450712330.jpg[/td][td]F4507[/td][td]
F450712330.jpg​
[/td][td]
[/td][td]F450712330.jpg / / / / / / / / [/td][td]F450712330.jpg[/td][td][/td][/tr]
[/table]
[Table="width:, class:grid"][tr][td]ForSOLTEC[/td][/tr][/table]



… correspondingly an attempt to give you a screen shot of the Formulas would be: -


Excel 2007
ABCDEFG
1ABCDEF
2Product Image(s)NUMBERUnique Numbers
3F126739347.jpgF4506JackS__tF4506JackS__t / JackS__t / JackS__t / JackS__t / JackS__t / F4506.jpg / F4506BACK.jpg / F4506SOLE.jpg / JackS__tF4506.jpg / F4506BACK.jpg / F4506SOLE.jpg /F4506.jpg / F4506BACK.jpg / F4506SOLE.jpg /
4F126839347.jpgF4506JackS__tF4507/ / / / / / / /F450712330.jpg
ForSOLTEC
Cell Formulas
RangeFormula
C3=IF(B3=LEFT(A3,5),A3,"JackS__t")
F3=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(E3," / / ",""),"JackS__t /","")," / JackS__t","")," / JackS__t",""),"JackS__t","")
G3=IFERROR(VLOOKUP(D3,B3:F40,5,FALSE),"")
D3{=IFERROR(INDEX($B$3:$B$40, MATCH(0, COUNTIF(D$2:$D2, $B$3:$B$40), 0),1),"")}
E3{=IFERROR(IF($B3=$B2,"",INDEX(IF($B3=$B3:$B$40,$C3:$C$40,""),COLUMNS($B:B),1)),"") & " / " & IFERROR(IF($B3=$B2,"",INDEX(IF($B3=$B3:$B$40,$C3:$C$40,""),COLUMNS($B:C),1)),"") & " / " & IFERROR(IF($B3=$B2,"",INDEX(IF($B3=$B3:$B$40,$C3:$C$40,""),COLUMNS($B:D),1)),"") & " / " & IFERROR(IF($B3=$B2,"",INDEX(IF($B3=$B3:$B$40,$C3:$C$40,""),COLUMNS($B:E),1)),"") & " / " & IFERROR(IF($B3=$B2,"",INDEX(IF($B3=$B3:$B$40,$C3:$C$40,""),COLUMNS($B:G),1)),"") & " / " & IFERROR(IF($B3=$B2,"",INDEX(IF($B3=$B3:$B$40,$C3:$C$40,""),COLUMNS($B:H),1)),"") & " / " & IFERROR(IF($B3=$B2,"",INDEX(IF($B3=$B3:$B$40,$C3:$C$40,""),COLUMNS($B:I),1)),"") & " / " & IFERROR(IF($B3=$B2,"",INDEX(IF($B3=$B3:$B$40,$C3:$C$40,""),COLUMNS($B:J),1)),"")& " / " & IFERROR(IF($B3=$B2,"",INDEX(IF($B3=$B3:$B$40,$C3:$C$40,""),COLUMNS($B:K),1)),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.







… I confess I have not got it quite as pretty and as well layed out as in that Thread, and so maybe in addition I will drop off the File I have been “tweaking” just now , to save you having to paste in those awkward formulas , including the CSE Ones. But I do explain everything much clearer in that Thread and I recommend that a review of that when you are up to it would be worthwhile.- Especially as there are more Function and VBA Code alternatives then I am capable of remembering just now that I did back in January. Possibly I could consider applying one of those as an VBA alternative if you wish in the next day or so…

… But any ways for now the XL ( 2007 ) File that you may wish to have a bit of a play around with….

https://app.box.com/s/76jm70vxiirk93zaubhet4fsw10u3sv3


.. You will note that I have juggled around a bit with the column order. Partly as mentioned this was to allow some extra Help Columns and also to try to bring it a bit consistent in layout to the Columns in that Thread to aid in understanding what is going on…
… Also I had to use / rather than ; as I using German Excel where ; interfere with my formulas. But a search and replace at your end should overcome that if required.

… See how you get on, and if the general direction could be appropriate for you. I confess I am more of a VBA man myself, and this was a somewhat untypical venture of mine into the complex formula area.
. Hope it may at least be a start point for you…

Alan

P.s. I reference quickly FlameRetired here
Copy cells going down a column with the same patient number to a single row.

where I got / learnt the main Part of this Formula approach..
 
Upvote 0
Doc,

Thank you for your long detailed explanation and formulas. I'm curious as to how or why I'm supposed to search for "JackS__t"? When my sample spreadsheet has not got one cell with that in it! I'm sorry for being dense, but I did suffer three strokes and am hoping that I'm not offending you, but I need this in English please. Step-by-Step if possible?
 
Upvote 0
…Thank you for your long detailed explanation and formulas. …..
…Your welcome.

…. did suffer three strokes and …
.. we have met a few times now in threads, you have mentioned it, and as I always replied ( also with PM ) I am in a similar position so particularly sympathize...

…………
… I'm curious as to how or why I'm supposed to search for "JackS__t"? When my sample spreadsheet has not got one cell with that in it!....

…as I mentioned part of tweaking my original Formula it was necessary to have some arbitrary name ( see Post #1 ) I was just amusing myself with JackS__t , which in my day ( as an experimental Physicist ) we amusingly used to represent empty . So if you prefer… in the formula in C column, this instead

Using Excel 2007
[Table="width:, class:grid"][tr][td]-[/td][td]
A
[/td][td]
B
[/td][td]
C
[/td][/tr]
[tr][td]
1
[/td][td][/td][td]
A​
[/td][td]
B​
[/td][/tr]

[tr][td]
2
[/td][td]Product Image(s)[/td][td]
NUMBER​
[/td][td]
[/td][/tr]

[tr][td]
3
[/td][td]F126739347.jpg[/td][td]F4506[/td][td]
=IF(B3=LEFT(A3,5),A3,"Empty")​
[/td][/tr]

[tr][td]
4
[/td][td]F126839347.jpg[/td][td]F4506[/td][td]
=IF(B4=LEFT(A4,5),A4,"Empty")​
[/td][/tr]
[/table]
[Table="width:, class:grid"][tr][td]ForSOLTEC[/td][/tr][/table]

To give this:

Using Excel 2007
[Table="width:, class:grid"][tr][td]-[/td][td]
A
[/td][td]
B
[/td][td]
C
[/td][td]
D
[/td][/tr]
[tr][td]
1
[/td][td][/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][/tr]

[tr][td]
2
[/td][td]Product Image(s)[/td][td]
NUMBER​
[/td][td]
[/td][td]
Unique Numbers​
[/td][/tr]

[tr][td]
3
[/td][td]F126739347.jpg[/td][td]F4506[/td][td]
Empty​
[/td][td]
F4506​
[/td][/tr]

[tr][td]
4
[/td][td]F126839347.jpg[/td][td]F4506[/td][td]
Empty​
[/td][td]
F4507​
[/td][/tr]

[tr][td]
5
[/td][td]F146739270.jpg[/td][td]F4506[/td][td]
Empty​
[/td][td]
[/td][/tr]

[tr][td]
6
[/td][td]F146739347.jpg[/td][td]F4506[/td][td]
Empty​
[/td][td]
[/td][/tr]

[tr][td]
7
[/td][td]F146839270.jpg[/td][td]F4506[/td][td]
Empty​
[/td][td]
[/td][/tr]

[tr][td]
8
[/td][td]F146839347.jpg[/td][td]F4506[/td][td]
Empty​
[/td][td]
[/td][/tr]

[tr][td]
9
[/td][td]F4506.jpg[/td][td]F4506[/td][td]
F4506.jpg​
[/td][td]
[/td][/tr]

[tr][td]
10
[/td][td]F4506BACK.jpg[/td][td]F4506[/td][td]
F4506BACK.jpg​
[/td][td]
[/td][/tr]

[tr][td]
11
[/td][td]F4506SOLE.jpg[/td][td]F4506[/td][td]
F4506SOLE.jpg​
[/td][td]
[/td][/tr]

[tr][td]
12
[/td][td]F4507.jpg[/td][td]F4506[/td][td]
Empty​
[/td][td]
[/td][/tr]
[/table]
[Table="width:, class:grid"][tr][td]ForSOLTEC[/td][/tr][/table]

.. Again as mentioned, one extra help column was needed anyway to get / check the first 5 characters, so it fitted inconveniently to put this mod / tweak in there..

………….
….. but I need this in English please. Step-by-Step ….

… I am probably working on less Brain cells then you at the moment, so I was pleasantly surprised my self how detailed and colorful I explained the basic formulas and ideas at the other Thread I referenced.
. The mods to get it too work for you are minimal. You should be able to follow through those explanations if I can!!

. But if you need more help, get back - I will help if I can

Alan.
 
Upvote 0
Hi SOLTEC, or anyone looking in on this thread in the Future..

. I was tidying up a similar requirement for myself and for some answering other Formula type Threads of this sort, so for completeness and so am sharing some stuff here…… ( .. and because of how my computers are being attacked by viruses these days this Forum is providing as good a place as any for me to “store” my codes and get at them later - !!!) …

. In the next post I start with complete general explanations of all formula parts, and right at the end I apply it specifically to the what I think is exactly or close to the required output from post #1 in this Thread. I would probably title this rambling something like

Formula to Sort columns of Data and Concatenate output in an adjacent column or columns

. - so I think it suits here. Particularly as one possible solution asked for was a Formula.
. ( Incidentally I am not sure how a function would work as a solution here. FWTFIW I would do this with a VBA code. Amongst other things the requirement lends itself to a simple looping / sorting / reorganizing type code. A formula as we will see becomes necessarily very long , messy and fills up a horrendous amount of the spreadsheet, especially if the final data size. But it was a good example to practice on….


…………..
Again FWIW

….. this code

Code:
[color=blue]Option[/color] [color=blue]Explicit[/color]
[color=blue]Sub[/color] SOLTECVBACode1()
[color=lightgreen]'VBA Array Method[/color]
[color=blue]Dim[/color] wsOrg [color=blue]As[/color] Worksheet: [color=blue]Set[/color] wsOrg = ThisWorkbook.Worksheets("VBACode") [color=lightgreen]'[/color]
[color=blue]Dim[/color] rws [color=blue]As[/color] [color=blue]Long[/color], r [color=blue]As[/color] Long 'variables for "rows" or "horizontal" count to be used in various loopings for row or first co ordinate in arrays'( Long is a Big whole Number limit (-2,147,483,648 to 2,147,483,647) -Most smaller numbers, Byte, Integer, Single are converted in computer to long so no advantage of Dim to smaller Type here)
[color=blue]Dim[/color] lr [color=blue]As[/color] Long: [color=blue]Let[/color] lr = wsOrg.Cells.Find(What:="*", after:=wsOrg.Cells(1, 1), Lookat:=xlPart, LookIn:=xlFormulas, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row [color=lightgreen]'Get last Row with entry anywhere for Sheet1. Method: You start at first cell then go backwards (which effectively starts at end of sheet), sercching for anything ( = * ) by rows, then get the row number. This allows for different excel versions with different available Row numbers) Just a different method here for fun- finds last row in sheet rather than row for last entry in particular cell[/color]
 
[color=lightgreen]'"Capture" Spreadsheet Data to Array[/color]
[color=blue]Dim[/color] arrOrg() [color=blue]As[/color] Variant: [color=blue]Let[/color] arrOrg() = wsOrg.Range("A1").CurrentRegion.Value [color=lightgreen]'One of many methods to capture[/color]
 
[color=lightgreen]'make an Array for Unique Search values, using a Tempory column[/color]
[color=blue]Dim[/color] lshtc [color=blue]As[/color] Long: [color=blue]Let[/color] lshtc = wsOrg.Columns.Count [color=lightgreen]'Number of Columns in sheet (May be differtent for different Excel versions[/color]
[color=lightgreen]'Let lshtc = 5 'For debugging to see the array bring it in "view"[/color]
[color=blue]Let[/color] wsOrg.Cells(1, lshtc) = "Unique" [color=lightgreen]'The last Column inn the sheet is used. (This has an advantage of not  interfering with our Method for getting lc). hee just for fun we give the array, that is to say the tempory column, a heading[/color]
    [color=blue]For[/color] rws = 2 [color=blue]To[/color] lr [color=blue]Step[/color] 1 [color=lightgreen]'Going down all rows  from just after heading[/color]
    [color=blue]On[/color] [color=blue]Error[/color] [color=blue]Resume[/color] [color=blue]Next[/color] [color=lightgreen]'This error handler is for the predicted error if no match, so below line errors in which case we go on at the line just after the next[/color]
        [color=blue]If[/color] wsOrg.Cells(rws, 1) <> "" And Application.WorksheetFunction.Match(wsOrg.Cells(rws, 1), wsOrg.Columns(lshtc), 0) = -1234 [color=blue]Then[/color] [color=lightgreen]'provided something is there, we check to see if that value is already in our vLook Up Array by looking to see for a match. If it is not there then, the predicted error occurs.......[/color]
        wsOrg.Cells(wsOrg.Rows.Count, lshtc).End(xlUp).Offset(1).Value = wsOrg.Cells(rws, 1).Value [color=lightgreen]'.....so we come here and put value in our tempory column for the unique values[/color]
        [color=blue]Else[/color] [color=lightgreen]'Else do nothing, we come here if no error, but match number was not -1234 - so .Match gave some co ordinate indicating value was alrerady there[/color]
        [color=blue]End[/color] [color=blue]If[/color]
    [color=blue]Next[/color] rws
[color=blue]Dim[/color] arrUniques() [color=blue]As[/color] Variant: [color=blue]Let[/color] arrUniques() = wsOrg.Range(wsOrg.Cells(2, lshtc), wsOrg.Cells(wsOrg.Cells(wsOrg.Rows.Count, lshtc).End(xlUp).Row, lshtc)).Value [color=lightgreen]'Array for unique values returned from assignong dynamic array to the last column tempory range[/color]
wsOrg.Columns(lshtc).Delete [color=lightgreen]'Delete the tempory Column (Delete is usually better than Clear.. >>  http://www.mrexcel.com/forum/excel-questions/787428-clear-delete-shift-%3Dxlup-let-y-%3D-y-%96-1-usedrange-rows-count-anomale.html[/color]
[color=lightgreen]'End of making an Array----------------------------------------[/color]
[color=lightgreen]'[/color]
'Loopin within array to produce required output array
[color=blue]Dim[/color] strTemp [color=blue]As[/color] [color=blue]String[/color] [color=lightgreen]'Temporary string to be used for concatenated output[/color]
Dim arrOut() [color=blue]As[/color] String: [color=blue]ReDim[/color] arrOut(1 [color=blue]To[/color] [color=blue]UBound[/color](arrUniques(), 1), 1 [color=blue]To[/color] 1) [color=lightgreen]'For consistence Set a 1 column 2 dimension array identical in size to the unique array. (ReDim must be used as Dim only takes actual numbers, not variables[/color]
    [color=blue]For[/color] rws = 1 [color=blue]To[/color] 1 [color=lightgreen]'UBound(arrOut(), 1) 'For each unique value[/color]
        [color=blue]For[/color] r = 1 [color=blue]To[/color] [color=blue]UBound[/color](arrOrg(), 1)
            [color=blue]If[/color] arrOrg(r, 1) = Left(arrOrg(r, 2), 5) [color=blue]Then[/color] [color=lightgreen]'match conditions met[/color]
            [color=blue]Let[/color] strTemp = strTemp & " ; " & arrOrg(r, 2)
            [color=blue]Else[/color]
            [color=blue]End[/color] [color=blue]If[/color]
        [color=blue]Next[/color] r
    [color=blue]If[/color] strTemp <> "" [color=blue]Then[/color]
    strTemp = VBA.Mid(strTemp, 4, Len(strTemp) - 3) [color=lightgreen]'Chop of first " ; "[/color]
    [color=blue]Let[/color] arrOut(rws, 1) = strTemp [color=lightgreen]'Output for this row[/color]
    [color=blue]Else[/color] [color=lightgreen]'No match conditions fpound, no concatenated string to put in outout array[/color]
    [color=blue]End[/color] [color=blue]If[/color]
    [color=blue]Next[/color] rws
 
[color=blue]Let[/color] wsOrg.Range("C2").Resize(UBound(arrOut(), 1), 1).Value = arrOut()
 
[color=blue]End[/color] [color=blue]Sub[/color]


… It would turn this:

<b></b><table cellpadding="1px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="text-align: center;color: #333333;background-color: #FFFFFF;;">Product ID</td><td style="text-align: center;color: #333333;background-color: #FFFFFF;;">Product Image(s)</td><td style="color: #333333;;">All Product Images for Product ID</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="background-color: #FFFF00;;">F4506</td><td style=";">F126739347.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style=";">F4506</td><td style=";">F126839347.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style=";">F4506</td><td style=";">F146739270.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style=";">F4506</td><td style=";">F146739347.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style=";">F4506</td><td style=";">F146839270.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style=";">F4506</td><td style=";">F146839347.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style=";">F4506</td><td style="background-color: #FFFF00;;">F4506.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style=";">F4506</td><td style="background-color: #FFFF00;;">F4506BACK.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style=";">F4506</td><td style="background-color: #FFFF00;;">F4506SOLE.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">11</td><td style=";">F4506</td><td style=";">F4507.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">12</td><td style=";">F4506</td><td style=";">F4507BACK.jpg</td><td style="color: #333333;;"></td></tr></tbody></table><p style="width:2,1em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">VBACode</p><br /><br />

……. Into thuis:..


<b></b><table cellpadding="1px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="text-align: center;color: #333333;background-color: #FFFFFF;;">Product ID</td><td style="text-align: center;color: #333333;background-color: #FFFFFF;;">Product Image(s)</td><td style="color: #333333;;">All Product Images for Product ID</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="background-color: #FFFF00;;">F4506</td><td style=";">F126739347.jpg</td><td style="color: #333333;;">F4506.jpg ; F4506BACK.jpg ; F4506SOLE.jpg</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style=";">F4506</td><td style=";">F126839347.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style=";">F4506</td><td style=";">F146739270.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style=";">F4506</td><td style=";">F146739347.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style=";">F4506</td><td style=";">F146839270.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style=";">F4506</td><td style=";">F146839347.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style=";">F4506</td><td style="background-color: #FFFF00;;">F4506.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style=";">F4506</td><td style="background-color: #FFFF00;;">F4506BACK.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style=";">F4506</td><td style="background-color: #FFFF00;;">F4506SOLE.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">11</td><td style=";">F4506</td><td style=";">F4507.jpg</td><td style="color: #333333;;"></td></tr><tr ><td style="color: #161120;text-align: center;">12</td><td style=";">F4506</td><td style=";">F4507BACK.jpg</td><td style="color: #333333;;"></td></tr></tbody></table><p style="width:2,1em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">VBACode</p><br /><br />

… But back to the Formula… in the next Thread..
 
Upvote 0
<o:p> </o:p>
Formula to Sort columns of Data and Concatenate output in an adjacent column or columns<o:p></o:p>
<o:p> </o:p>
. Very difficult to know where to start, I find. It is also very difficult to break down into logical steps as some steps are a Chicken and Egg thing. But bear with me, - I will try to keep the progression semi-logical. A particular characteristic of the problem is the transposing of data, and the nice thing here from the title is that we have left it vague enough that is not clear whether we mean the data will be adjacent cells “pseudo” concatenated as they are alongside each other or truly concatenated, possibly including an extra separator character such as a comer , with the entire data . So I will start with the former ( as I have a good reference for that <o:p></o:p>
http://www.excelforum.com/excel-general/1059434-copy-cells-going-down-a-column-with-the-same-patient-number-to-a-single-row.html<o:p></o:p>
FlameRetired <o:p></o:p>
…. And then adapt it to the Latter). <o:p></o:p>
<o:p> </o:p>
. The following would be a very general example of two columns from the left of initial data which in a form, at least similar, to the adjacent rows should be returned by the formula. The exact output may be a bit different, that is to say output in different rows. ( I will try to allow for this in the following explanations ) <o:p></o:p>
<o:p> </o:p>
UsingExcel 2007<o:p></o:p>
[Table="width:,class:grid"]<o:p></o:p>
[tr][td]
GivenKategory or Sort Box No.​
[/td][td]
PartNumber.​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr][tr][td]
a​
[/td][td]
K2OLE​
[/td][td]
K2OLE​
[/td][td]
K3Wop​
[/td][td]
[/td][td]
[/td][/tr][tr][td]
c​
[/td][td]
K9F-Tang​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr][tr][td]
b​
[/td][td]
K4F-Tang​
[/td][td]
K4F-Tang​
[/td][td]
K5WigyWam​
[/td][td]
K6Biscuit​
[/td][td]
K7Barrel​
[/td][/tr][tr][td]
b​
[/td][td]
K5WigyWam​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr][tr][td]
b​
[/td][td]
K6Biscuit​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr][tr][td]
b​
[/td][td]
K7Barrel​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr][tr][td]
c​
[/td][td]
K8DuWolly​
[/td][td]
K9F-Tang​
[/td][td]
K8DuWolly​
[/td][td]
[/td][td]
[/td][/tr][tr][td]
a​
[/td][td]
K3Wop​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr][/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>
<o:p> </o:p>
. <o:p></o:p>
<o:p> </o:p>
…………………………………………………………………………………………..<o:p></o:p>
<o:p> </o:p>
. Working backwards it was found that splitting the Sorting – and concatenating of results kind of were treated separately, so in the actual spreadsheet I will organize it to give me space at the left of Column N for sorting, and to the right for the output of concatenated results. <o:p></o:p>
<o:p> </o:p>
UsingExcel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
J
[/td][td]
K
[/td][td]
L
[/td][td]
M
[/td][td]
N
[/td][td]
O
[/td][td]
P
[/td][td]
Q
[/td][td]
R
[/td][/tr][tr][td]
1
[/td][td]
SortedKategory or Sort Box No.​
[/td][td]
PartNumber.​
[/td][td]
Given Kategory or Sort BoxNo.​
[/td][td]
PartNumber.​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr][tr][td]
2
[/td][td]
a​
[/td][td]
K2OLE​
[/td][td]
a​
[/td][td]
K2OLE​
[/td][td]
[/td][td]
K2OLE​
[/td][td]
K3Wop​
[/td][td]
[/td][td]
[/td][/tr][tr][td]
3
[/td][td]
a​
[/td][td]
K3Wop​
[/td][td]
c​
[/td][td]
K9F-Tang​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr][tr][td]
4
[/td][td]
b​
[/td][td]
K4F-Tang​
[/td][td]
b​
[/td][td]
K4F-Tang​
[/td][td]
[/td][td]
K4F-Tang​
[/td][td]
K5WigyWam​
[/td][td]
K6Biscuit​
[/td][td]
K7Barrel​
[/td][/tr][tr][td]
5
[/td][td]
b​
[/td][td]
K5WigyWam​
[/td][td]
b​
[/td][td]
K5WigyWam​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr][tr][td]
6
[/td][td]
b​
[/td][td]
K6Biscuit​
[/td][td]
b​
[/td][td]
K6Biscuit​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr][tr][td]
7
[/td][td]
b​
[/td][td]
K7Barrel​
[/td][td]
b​
[/td][td]
K7Barrel​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr][tr][td]
8
[/td][td]
c​
[/td][td]
K9F-Tang​
[/td][td]
c​
[/td][td]
K8DuWolly​
[/td][td]
[/td][td]
K9F-Tang​
[/td][td]
K8DuWolly​
[/td][td]
[/td][td]
[/td][/tr][tr][td]
9
[/td][td]
c​
[/td][td]
K8DuWolly​
[/td][td]
a​
[/td][td]
K3Wop​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr][/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>

<o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p>
…………<o:p></o:p>
<o:p> </o:p>
Concatenating (sorted ) Column data <o:p></o:p>
.a) Transposing Rows to Columns<o:p></o:p>
. Start point is that the data is in a sorted state, what in the practice either is, or would be required to be done in addition to the concatenating…. Using slightly modified data to help in the explanation.<o:p></o:p>
. <o:p></o:p>
UsingExcel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
J
[/td][td]
K
[/td][td]
L
[/td][td]
M
[/td][td]
N
[/td][td]
O
[/td][td]
P
[/td][/tr][tr][td]
1
[/td][td]OrderedCategory or Sort Box[/td][td]OrderedPart Number[/td][td]Given Category or Sort Box[/td][td]Given PartNumber[/td][td][/td][td][/td][td][/td][/tr][tr][td]
2
[/td][td]a[/td][td]K2[/td][td][/td][td][/td][td][/td][td]K2[/td][td]K3[/td][/tr][tr][td]
3
[/td][td]a[/td][td]K3[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
4
[/td][td]a[/td][td]K4[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
5
[/td][td]a[/td][td]K5[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
6
[/td][td]a[/td][td]K6[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
7
[/td][td]a[/td][td]K7[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
8
[/td][td]a[/td][td]K8[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
9
[/td][td]a[/td][td]K9[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
10
[/td][td]a[/td][td]K10[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
11
[/td][td]b[/td][td]K11[/td][td][/td][td][/td][td][/td][td]K11[/td][td]K12[/td][/tr][tr][td]
12
[/td][td]b[/td][td]K12[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]<o:p></o:p>

[/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>
<o:p> </o:p>
..<o:p></o:p>
<o:p> </o:p>
. The final formula in this section .a) has an immediate “unnecessary” complication. <o:p></o:p>
<o:p> </o:p>
=IF(ISERROR( IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:J),2)) ) , "" , IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39 , $J2:$K$39 , ""),COLUMNS($J:J),2)) )<o:p></o:p>
<o:p> </o:p>
.. clearly to see are two sections identical. This to use the XL2003 allowed error handling Formula syntax <o:p></o:p>
IF(ISERROR(_________);"";(_________))<o:p></o:p>
Rather than that only available from XL 2007<o:p></o:p>
IFERROR(________;"") <o:p></o:p>
.. for compatibility. The equivalent XL 2007 formula would be<o:p></o:p>
<o:p> </o:p>
=IFERROR( IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:J),2)) ,"" )<o:p></o:p>
<o:p> </o:p>
And is possibly a bit simpler to follow….<o:p></o:p>
<o:p> </o:p>
Here <o:p></o:p>
IF($J2=$J1,"",INDEX( IF($J2=$I2:$J$39,$J2:$K$39,"") , COLUMNS($J:J) , 2 ))<o:p></o:p>
<o:p> </o:p>
The IF($J2=$J1 results in us only returning results for one particular category, that is at the point in the list where a different category starts where $J2<>$J1 (Initially starting at row 2, the comparison is done with a category $J2 and the header, $J1 but the result is the same that is to say $J2<>$J1 so the Else bit ( third argument of the IF is initiated, i.e. the INDEX )<o:p></o:p>
<o:p> </o:p>
The COLUMNS($J:J) is here the second argument ( the row index ) for the INDEX( function. This gives an increasing row index ( next row down ) as we drag the formula to the right. This gives the basic Transposing ( Columns to rows ) requirement.<o:p></o:p>
<o:p> </o:p>
. The basic required index formula for giving the transposing (rows to columns ) would be satisfied by this.<o:p></o:p>
<o:p> </o:p>
=IFERROR (IF($J2=$J1,"" , INDEX( $J2:$K$39 , COLUMNS($J:J) , 2 ) ) ,"")<o:p></o:p>
<o:p> </o:p>
. The subtle problem here is that when dragging the formula across, for example in the first row,, the COLUMNS($J:S) argument exceeds the rows for the current category, so it will continue to return output values, starting at the next category and so on…. <o:p></o:p>
. There are probably various ways to take care of this. A big spanner in the works in taking the explanation further now is the “ Mystery of CSE “ . If you cannot or don’t want to get over that hurdle, give up reading this. I cannot be much help here other than in the unlikely event that you have some warped way of thinking similar to me: Then the link below gives you a WORD 2007 .doc that I wrote for my own amusement titled “CSEWhistleBlower.doc”<o:p></o:p>
- But note it is a mixture of Fact and Fiction, Think of it as how you used in the school to remember important Formulas by doing some abstract comparison or turning the thing into a dopey song – I turn it into a Nutty Story<o:p></o:p>
<o:p> </o:p>
. So I will wait. <o:p></o:p>
Link ( … XL 2007.doc CSEWhistleBlower.doc <o:p></o:p>
https://app.box.com/s/avk6paydbtame1hz7ge5zenh6ll1p35e<o:p></o:p>
…. )<o:p></o:p>
<o:p> </o:p>
. OK . – remember a couple of points about CSE: Referenced Ranges are fixed ( as they have been done anyway, ! ) and “ Array type mathematics / analysis. <o:p></o:p>
. Looking in detail at the INDEX part<o:p></o:p>
<o:p> </o:p>
INDEX( IF($J2=$I2:$J$39,$J2:$K$39,"") , COLUMNS($J:J) ,2)<o:p></o:p>
<o:p> </o:p>
. Basically we have an IF condition based on the True condition resulting from the comparisons $J2=$I2:$J$39 It would really make this rambling even more ToFLong ToFRead, to explain the exact details here. But try this. Go down the cells in column O , click in the formula bar above, highlight this bit $J2=$I2:$J$39 , Hit F9 ( which does an instant evaluation of that part of the formula highlighted ). You will get an array ( In this case two columns and 38 rows – we are using the index column 2 ) Pay particular attention to the True or False in the second column in the rows . Repeat this looking at each formula in Row 2. You will note that the Array is the same by virtual of a $ on all column Letters. Lookin “down that second Array column you see that the first 9 “rows” give a True. This is because the value of $J2 which is a is given 9 times down that “column. By virtual of the Array type mathematics / analysis” the IF(________) statement within a CSE gives an output array ( in this case “38 rows x 2 columns” with the corresponding value in that position in the ,$J2:$K$39 Array for a True condition in $I2:$J$39 and by default with no further ( third ) argument gives a “FALSE” at places where there is a False in $I2:$J$39 . However, we may use the third argument to specify the default output to be put in that array if we have the false condition. ( The exact syntax of the IF(________) within a CSE environment is discussed in detail from Post # 6<o:p></o:p>
http://www.mrexcel.com/forum/excel-questions/855055-index-formula-expected-error-errors-sometimes-sometimes-returns-empty-cell-help-formula-expert-needed.html<o:p></o:p>
. At this point we have a valid Array argument ( Grid ) for the first argument of the INDEX<o:p></o:p>
<o:p> </o:p>
. One last final note in this section, or rather the current part of the Formula being focused on.: We could ( and in the practice usually do ) use the Index with a single column, in particular that we are primarily interested in, J and correspondingly select the first column in the third ( column ) argument thus<o:p></o:p>
<o:p> </o:p>
IF($J2=$J1,"",INDEX(IF($J2=$J2:$J$39,$K2:$K$39,""),COLUMNS($J:J),1))<o:p></o:p>
<o:p> </o:p>
which can further be simplified by relying on the default<o:p></o:p>
<o:p> </o:p>
IF($J2=$J1,"",INDEX(IF($J2=$J2:$J$39,$K2:$K$39,""),COLUMNS($J:J)))<o:p></o:p>
<o:p> </o:p>
. I simply prefer to extend to more columns ( I use here 2, but I could even use more ) as this helps <o:p></o:p>
. (i) remind me of what / how the Index is used,<o:p></o:p>
. (ii) It keeps me open minded to other possibilities when developing the formula, ( but for the life of me I struggle to see how in this case that is possible )<o:p></o:p>
<o:p> </o:p>
. The very last point in this section is the very outer error Handling part. This final IF(ISERROR(_________);"";(_________)) ( or IFERROR(_______;””) for XL 2007 ) is tacked on to take care of the case of us going to the right eventually resulting in the Column Function returning a Look Up Row for the Index Grid that lies outside its Upper Bound in the vertical direction – so instead of an error we get nothing again (which is wot we want, in that case) <o:p></o:p>
<o:p> </o:p>
https://app.box.com/s/ltznlczywkdtexrtnd9xa3kx4azqh6gz<o:p></o:p>
<o:p> </o:p>
Notes. A couple of last tips when playing with the “F9 expose array innerds” trick in the formula bar..<o:p></o:p>
. (i) To return to seeing the normal formula in the formula bar hit ESC<o:p></o:p>
. (ii) Be careful not to leave that cell with an Enter. Either leave it with CSE or click somewhere else in the spreadsheet. (or else you will lose the {}<o:p></o:p>
<o:p> </o:p>
.b) Concatenating Transposed Rows cells to a single cell<o:p></o:p>
<o:p> </o:p>
. This is actually my only contribution to Dave’s (FlameRetired’s) Formula. Not surprisingly it is fairly straight forward. One simply goes along in any row, for example row 2, cutting out the cell formula in the cells after the first ( O2 ) , and pasting them in the first cell ( O2 ), and paste it along side the Formula in cell O2 with a Concatenation ampersand ( & ). Additionally the separator string part ( & “ , “ ) is added appropriately similarly in the correct syntax with an ampersand and quotation marks. The exact position of the separator string part can give slightly different results. A bit of experimenting with that makes that clear. Here for clarity is just the first concatenation<o:p></o:p>
<o:p> </o:p>
=IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:J),2) & " , ")),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:J),2) & " , ")) & IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:K),2) & " , ")),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:K),2) & " , "))<o:p></o:p>
<o:p> </o:p>
And correspondingly the results:<o:p></o:p>
<o:p> </o:p>
UsingExcel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
J
[/td][td]
K
[/td][td]
L
[/td][td]
M
[/td][td]
N
[/td][td]
O
[/td][/tr][tr][td]
1
[/td][td]OrderedCategory or Sort Box[/td][td]OrderedPart Number[/td][td]Given Category or Sort Box[/td][td]Given PartNumber[/td][td][/td][td][/td][/tr][tr][td]
2
[/td][td]a[/td][td]K2[/td][td][/td][td][/td][td][/td][td]K2, K3 ,[/td][/tr][tr][td]
3
[/td][td]a[/td][td]K3[/td][td][/td][td][/td][td][/td][td][/td][/tr]<o:p></o:p>

[/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>
<o:p> </o:p>
. Producing the following full Formula may appear somewhat tedious. It F___ing was. But <o:p></o:p>
. (i) It must only be done once, (As before it is dragged down and across)<o:p></o:p>
. (ii) This type of Formula string lends itself nicely to being produced by a VBA code. I shall do that as a further follow up..( next year probably.. )<o:p></o:p>
<o:p> </o:p>
UsingExcel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
O
[/td][/tr]<o:p></o:p>

[tr][td]
2
[/td][td]=IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:J),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:J),2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:K),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:K),2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:L),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:L),2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:M),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:M),2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:N),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:N),2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:O),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:O),2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:P),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:P),2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:Q),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:Q),2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:R),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:R),2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:S),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:S),2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:T),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:T),2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:U),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:U),2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:V),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:V),2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:W),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:W),2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:X),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:X),2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:Y),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:Y),2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:Z),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:Z),2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:AA),2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),COLUMNS($J:AA),2)))[/td][/tr]<o:p></o:p>

[/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>
<o:p> </o:p>
https://app.box.com/s/9tskcgojqlzopa11mq230rbbll4rqvry<o:p></o:p>
<o:p> </o:p>
.c) Removing / replacing COLUMNS($J:_) with explicit number<o:p></o:p>
. From the complexity this is hardly worth its own section.. but it is extremely important.. or it can catch you out. Until now we were using many columns to the right and it was convenient to use COLUMNS($J:_) to get at the row index for the INDEX Function through dragging left to right..<o:p></o:p>
.. and we were hardly likely to delete or add columns.. This is not the case now, and I found that in the practice I got caught out when I did anything in the now “available columns which involved Adding or deleting columns.. this can basically confuse / muck up the referencing to these columns in the big formula. So we simply replace COLUMNS($J:_) with the actual number. Again this was very tedious to do, but in the practice lends itself very nicely to a code to produce the formula string, in particular that it demonstrate an important criteria / size constraints with this method. The number of arguments of a similar form which we have will determine the row length for a particular category. In the case of this example, as I was doing it by hand , I went as far as I needed to, which was enough to catch the 18 entries for category c . If , as I propose , to produce such a formula in a code, there would probably be a loop, of count equal to the maximum number of rows for a particular category… Convenient eh??<o:p></o:p>
<o:p> </o:p>
Using Excel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
O
[/td][/tr]<o:p></o:p>

[tr][td]
2
[/td][td]=IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),1,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),1,2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),2,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),2,2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),3,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),3,2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),4,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),4,2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),5,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),5,2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),6,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),6,2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),7,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),7,2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),7,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),7,2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),8,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),8,2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),9,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),9,2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),10,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),10,2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),11,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),11,2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),12,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),12,2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),13,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),13,2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),14,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),14,2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),15,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),15,2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),16,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),16,2)))&IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),17,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),17,2)))[/td][/tr]<o:p></o:p>

[/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>
https://app.box.com/s/8rtfi0mfy1t86fjve4o8xu89648ltng8<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
.d) Including separators and other minor modes. <o:p></o:p>
<o:p> </o:p>
. Again a very simple mod.. the exact position of the separator can be experimented, keeping it within the formulas rather than adding it between was found to be more appropriate to simplify further developing of the formulas.. but some experimenting can be done with this. And once again I leave that until I have a code for producing the string.. Here I use the pipe for separator. ( I choose to keep with this because of different German / English . and , decimal conventions and the different , and ; conventions in formulas. These can often cause syntax problems )<o:p></o:p>
<o:p> </o:p>
IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),1,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),1,2) & " | ")) & ……….<o:p></o:p>
………………….<o:p></o:p>
…………………..IF(ISERROR(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),18,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),18,2) & " | ")) <o:p></o:p>
<o:p> </o:p>
. This does have the effect of returning unwanted | in the places where the INDEX returns a empty, but most can be wiped out easily with something of this form, <o:p></o:p>
<o:p> </o:p>
SUBSTITUTE( IF( ISERROR(IF($J2=$J1,"",INDEX(IF………..<o:p></o:p>
………………..<o:p></o:p>
<o:p> </o:p>
…………………..=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),18,2))),"",IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$39,$J2:$K$39,""),18,2) & " | ")) , " | | " , "" )<o:p></o:p>
https://app.box.com/s/vdouil939hcvp4ojm925rnxburimp9cx<o:p></o:p>
<o:p> </o:p>
……………..<o:p></o:p>
<o:p> </o:p>
. One | can be left over. Many simple methods can be used to remove that. …. <o:p></o:p>
<o:p> </o:p>
.ef1). <o:p></o:p>
<o:p> </o:p>
… but the actual formula can look a bit nasty… For example this basic form<o:p></o:p>
<o:p> </o:p>
We would have…<o:p></o:p>
<o:p> </o:p>
https://app.box.com/s/vdfwz67uetw9q5ifmy9zniwzii1amzhq<o:p></o:p>
<o:p> </o:p>
Using Excel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
O
[/td][/tr]<o:p></o:p>

[tr][td]
2
[/td][td]=IF(RIGHT(SUBSTITUTE(IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,"Jack****"),1,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),2,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),3,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),4,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),5,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),6,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),7,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),8,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),9,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),10,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),11,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),12,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),13,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),14,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),15,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),16,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),17,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),18,2)& " | ")," | | ",""),3)=" |",MID(SUBSTITUTE(IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,"Jack****"),1,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),2,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),3,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),4,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),5,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),6,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),7,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),8,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),9,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),10,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),11,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),12,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),13,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),14,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),15,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),16,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),17,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),18,2)& " | ")," | |",""),1,LEN(SUBSTITUTE(IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,"Jack****"),1,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),2,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),3,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),4,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),5,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),6,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),7,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),8,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),9,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),10,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),11,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),12,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),13,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),14,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),15,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),16,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),17,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),18,2)& " | ")," | |",""))-3),SUBSTITUTE(IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,"Jack****"),1,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),2,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),3,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),4,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),5,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),6,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),7,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),8,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),9,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),10,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),11,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),12,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),13,2)& " | ") & IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),14,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),15,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),16,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),17,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),18,2)& " | ")," | | ",""))[/td][/tr]<o:p></o:p>

[/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>
<o:p> </o:p>
https://app.box.com/s/h8vu0sgsxvvy7f1ro6tz7xmlztubkudy<o:p></o:p>
<o:p> </o:p>
.f) Alternative “Error Handler”. <o:p></o:p>
<o:p> </o:p>
. Assuming for now the explanations at the end of section a) are valid, that is to say the “Error Handler” is only needed for the “overshoot” when the columns / Rows exceed that determined by the end of the table, then simply extending INDEX Grid (Array) Range to some arbitrary large amount will overcome this problem , and based on the discussions generally so far , that would not immediately drastically affect how our formula is working… so a much simplified version ( ..Independent now of XL versions )…<o:p></o:p>
<o:p> </o:p>
=SUBSTITUTE(IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),1,2) & " | ") & IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),2,2) & " | ") & IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),3,2) & " | ") & IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),4,2) & " | ") & IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),5,2) & " | ") & IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),6,2) & " | ") & IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),7,2) & " | ") & IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),8,2) & " | ") & IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),9,2) & " | ") & IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),10,2) & " | ") & IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),11,2) & " | ") & IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),12,2) & " | ") & IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),13,2) & " | ") & IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),14,2) & " | ") & IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),15,2) & " | ") & IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),16,2) & " | ") & IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),17,2) & " | ") & IF($J2=$J1,"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),18,2) & " | ")," | | ","")<o:p></o:p>
<o:p> </o:p>
. Furthermore, this extended “Range” could then be “used” , that is to say the formula could be drags down further to include this extended range therefore allowing additional data to be included without changing the sheet formulas. One minor problem arise then as the change at the end of the sheet from a value to an empty in column J will satisfy this part IF($JX=$JX-1 , resulting in a cell of concatenated 0s thus<o:p></o:p>
<o:p> </o:p>
Using Excel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
J
[/td][td]
K
[/td][td]
L
[/td][td]
M
[/td][td]
N
[/td][td]
O
[/td][/tr][tr][td]
38
[/td][td]c[/td][td]K38[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
39
[/td][td]d[/td][td]K39[/td][td][/td][td][/td][td][/td][td]K39[/td][/tr][tr][td]
40
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td]0| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |[/td][/tr][tr][td]
41
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
42
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]<o:p></o:p>

[/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>
<o:p> </o:p>
. This can simply be overcome with some Boolean Stuff – so changing this $J2=$J1 everywhere, with this OR($J2=$J1,$J2="")<o:p></o:p>
<o:p> </o:p>
https://app.box.com/s/mktl5kqgfx1wbhxtezbsjz8p7zk21lpv<o:p></o:p>
<o:p> </o:p>
.g) Grouping Initial Data (Sorting). <o:p></o:p>
<o:p> </o:p>
. The following is one demonstration of the somewot “Chicken and Egg”nature of Formula writing. Our Formula until now would not work if the initialdata was not grouped together nicely.<o:p></o:p>
<o:p> </o:p>
UsingExcel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
J
[/td][td]
K
[/td][td]
L
[/td][td]
M
[/td][td]
N
[/td][td]
O
[/td][/tr][tr][td]
1
[/td][td]OrderedCategory or Sort Box[/td][td]OrderedPart Number[/td][td]Given Category or Sort Box[/td][td]Given PartNumber[/td][td][/td][td][/td][/tr][tr][td]
2
[/td][td]a[/td][td]K2[/td][td][/td][td][/td][td][/td][td]K2| K3K5 | K6K8 | K9 |K10[/td][/tr][tr][td]
3
[/td][td]a[/td][td]K3[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
4
[/td][td]b[/td][td]K4[/td][td][/td][td][/td][td][/td][td]K4| K11 | K12 | K13 | K14 | K15 | K16 | K17 | K18 | K19 |K20[/td][/tr][tr][td]
5
[/td][td]a[/td][td]K5[/td][td][/td][td][/td][td][/td][td]K5| K6K8 | K9 | K10 | [/td][/tr][tr][td]
6
[/td][td]a[/td][td]K6[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
7
[/td][td]c[/td][td]K7[/td][td][/td][td][/td][td][/td][td]K7K21| K22 | K23 | K24 |[/td][/tr][tr][td]
8
[/td][td]a[/td][td]K8[/td][td][/td][td][/td][td][/td][td]K8| K9 |K10[/td][/tr][tr][td]
9
[/td][td]a[/td][td]K9[/td][td][/td][td][/td][td][/td][td][/td][/tr]<o:p></o:p>

[/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>
<o:p></o:p>
<o:p> </o:p>
It is therefore handy to include in the formula some part to do this. The following basic formula I take no credit for, I not only could not work it out but I also couldn’t even find the well explained one that was already available in Internet . I was pointed in the right direction here<o:p></o:p>
http://www.mrexcel.com/forum/excel-questions/854041-excel-formula-sort-table-order-novice-%93part-%96-timer%94-member-would-appreciate-some-help-form-board-formula-master-2.html<o:p></o:p>
by MrExcel Member FormR<o:p></o:p>
. I will at least try to use and explain it applying it to our case. I will cut the columns initially from Columns J – K and paste them in H and I, jumble the order a bit, and then attempt to use this to replace our original data into Columns J . K. <o:p></o:p>
<o:p> </o:p>
. Here the data and Formulas to be considered along with the results…<o:p></o:p>
<o:p> </o:p>
UsingExcel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
H
[/td][td]
I
[/td][td]
J
[/td][td]
K
[/td][td]
L
[/td][td]
M
[/td][td]
N
[/td][td]
O
[/td][/tr][tr][td]
1
[/td][td]UngroupedCategory or Sort Box[/td][td]UngroupedPart Number[/td][td]Ordered Category or Sort Box[/td][td]Ordered Part Number[/td][td]Given Category or SortBox[/td][td]Given Part Number[/td][td][/td][td][/td][/tr][tr][td]
2
[/td][td]a[/td][td]I2[/td][td]a[/td][td]I2[/td][td][/td][td][/td][td][/td][td]I2| I3 | I5 | I6 | I8 | I9 | I10 | I15 |[/td][/tr][tr][td]
3
[/td][td]a[/td][td]I3[/td][td]a[/td][td]I3[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
4
[/td][td]b[/td][td]I4[/td][td]a[/td][td]I5[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
5
[/td][td]a[/td][td]I5[/td][td]a[/td][td]I6[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
6
[/td][td]a[/td][td]I6[/td][td]a[/td][td]I8[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
7
[/td][td]c[/td][td]I7[/td][td]a[/td][td]I9[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
8
[/td][td]a[/td][td]I8[/td][td]a[/td][td]I10[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
9
[/td][td]a[/td][td]I9[/td][td]a[/td][td]I15[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
10
[/td][td]a[/td][td]I10[/td][td]b[/td][td]I4[/td][td][/td][td][/td][td][/td][td]I4| I11 | I12 | I13 | I14 | I16 | I17 | I18 | I19 | I20 |[/td][/tr][/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]
Using Excel2007[Table="width:,class:grid"][tr][td]-[/td][td]
H
[/td][td]
I
[/td][td]
J
[/td][td]
K
[/td][td]
L
[/td][td]
M
[/td][td]
N
[/td][td]
O
[/td][/tr][tr][td]
1
[/td][td]UngroupedCategory or Sort Box[/td][td]UngroupedPart Number[/td][td]Ordered Category or Sort Box[/td][td]Ordered Part Number[/td][td]Given Category or SortBox[/td][td]Given PartNumber[/td][td][/td][td][/td][/tr][tr][td]
2
[/td][td]a[/td][td]I2[/td][td]a[/td][td]I2[/td][td][/td][td][/td][td][/td][td]I2| I3 | I5 | I6 | I8 | I9 | I10 | I15 |[/td][/tr][tr][td]
3
[/td][td]a[/td][td]I3[/td][td]a[/td][td]I3[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
4
[/td][td]b[/td][td]I4[/td][td]a[/td][td]I5[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
5
[/td][td]a[/td][td]I5[/td][td]a[/td][td]I6[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
6
[/td][td]a[/td][td]I6[/td][td]a[/td][td]I8[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
7
[/td][td]c[/td][td]I7[/td][td]a[/td][td]I9[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
8
[/td][td]a[/td][td]I8[/td][td]a[/td][td]I10[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
9
[/td][td]a[/td][td]I9[/td][td]a[/td][td]I15[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
10
[/td][td]a[/td][td]I10[/td][td]b[/td][td]I4[/td][td][/td][td][/td][td][/td][td]I4| I11 | I12 | I13 | I14 | I16 | I17 | I18 | I19 | I20 |[/td][/tr][/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>

<o:p> </o:p>
….. and here the formulas to be explained<o:p></o:p>
<o:p> </o:p>
UsingExcel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
H
[/td][td]
I
[/td][td]
J
[/td][td]
K
[/td][/tr][tr][td]
1
[/td][td]UngroupedCategory or Sort Box[/td][td]UngroupedPart Number[/td][td]Ordered Category or Sort Box[/td][td]Ordered PartNumber[/td][/tr][tr][td]
2
[/td][td]a[/td][td]I2[/td][td]=INDEX($H$2:$H$39,MATCH(SMALL(COUNTIF($H$2:$H$39,"<"&$H$2:$H$39),ROWS($J$1:J1)),COUNTIF($H$2:$H$39,"<"&$H$2:$H$39), 0))[/td][td]=INDEX($I$2:$I$39,SMALL(IF($H$2:$H$39=J2,ROW($H$2:$H$39)-ROW($H$2)+1),COUNTIF($J$2:J2,J2)))[/td][/tr][/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>

<o:p> </o:p>
The main sort formula first.. ( CSE Type 1 ##)<o:p></o:p>
<o:p> </o:p>
=INDEX( $G$2:$H$39 , MATCH( SMALL( COUNTIF($H$2:$H$39, "<"&$H$2:$H$39) , ROWS($J$1:J1)) , COUNTIF($H$2:$H$39, "<"&$H$2:$H$39) , 0 ) 2 )<o:p></o:p>
<o:p> </o:p>
. we will start off with the<o:p></o:p>
COUNTIF($H$2:$H$39, "<"&$H$2:$H$39).. <o:p></o:p>
.. which nicely has a full set of $ so it is a reference being used throughout – part of it is the search criteria ( Look Up Value ) of the first argument in a the MATCH( and the whole of it is the Look Up Table ( vertical Array / 1 – dimensional column of that ) MATCH <o:p></o:p>
. We are in the Array correct world of CSE ## so what is going on and the explanations thereof must bear that in mind…. The “CSE-intaxly” way this works is to take each H_ value from H2 downwards and count how many times ( Count If - get it!) this H_ value is less than all the H_ values in the list. Highlighting COUNTIF($H$2:$H$39, "<"&$H$2:$H$39) and doing the usual Hit F9 trick makes that very clear in this example…<o:p></o:p>
{0;0;8;0;0;18;0;0;0;8;8;8;8;0;8;8;8;8;8;18;18;18;18;18;18;18;18;18;18;18;18;18;18;18;18;18;18;37}<o:p></o:p>
… clearly, for example, the last H_ value we check has d in it , the biggest ( alphabetically d > ( a or b or c ) ) , is 37 times greater than the other 36 letters in the H column going from H2 to H38<o:p></o:p>
. So we have the Look Up Table ( Array / vertical column) for our MATCH and at the same time the first argument in the SMALL Function ( Look Up Table / Array ) . The SMALL function gives the N th smallest value in the first argument Array, where N is the second argument of the SMALL Function. ( SMALL( Array , N ) ) <o:p></o:p>
… note importantly that we have a H_ and not $H_ so this ROWS($J$1:$J_) returns 1 to 38 as we go down. So Clearly we find the next smallest value in the H column. This is given then to the MATCH, to give the co – ordinate. We have the important info now for the Match ( the last entry 0 or 1 or True or False is simply the usual exactness of match thing for these sort of Functions )<o:p></o:p>
.<o:p></o:p>
. The above MATCH has given us the co-ordinate down the H column ( Row number in the array ) for the next smallest, in other words the one next bigger than the last column looked at……. <o:p></o:p>
( Row = MATCH( SMALL( COUNTIF($H$2:$H$39, "<"&$H$2:$H$39) , ROWS($J$1:J1)) , COUNTIF($H$2:$H$39, "<"&$H$2:$H$39) , 0 ) <o:p></o:p>
. We now have all we need to select the appropriate value along each row, and as typical this lends itself to an INDEX Function…<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
=INDEX( $G$2:$H$39 , Row , 2 )<o:p></o:p>
<o:p> </o:p>
.<o:p></o:p>
. This fairly normal INDEX Function has a fixed range for its first argument ( Look Up Table / Array / Grid ) ( which can for these purpose be any containing the column of interest , H, and the above MATCH in the second argument returns the appropriate row. The column of 2 is in conjunction with choosing G-H is just my reminder again of what functions are being used. Most people Would just use H Column, and ,1 , or rather just the H and neglecting the ,1 which would be the default taken by Excel by excluding it <o:p></o:p>
.. my final formula..<o:p></o:p>
=INDEX($G$2:$I$39, MATCH(SMALL(COUNTIF($H$2:$H$39,"" & "<"&""&$H$2:$H$39&""), ROWS($J$1:$J1)), COUNTIF($H$2:$H$39, "<"&$H$2:$H$39), 0),2)<o:p></o:p>
<o:p> </o:p>
. a point not immediately obvious from the above is that unfortunately the category values given ( a , b , c , d here ) are not actually the specific category values from the unsorted column, but rather that of the first time it occurs repeated as many times as that particular category occurs. ( in other words we are always using a from cell J2 , b from cell J4, c from cell J7, d from cell J39 ) Because of this, extending my habit to 3 columns extending over to column I and attempting to simply select column 3 rather than 2 does not therefore work.. So a completely different approach is necessary for getting the correct second column…<o:p></o:p>
<o:p> </o:p>
https://app.box.com/s/5ysmli4gx8wp3hbv5zne4hoqnfskaq6y<o:p></o:p>
<o:p> </o:p>
.h) Extending Grouping for two columns. <o:p></o:p>
. Here we investigate the second formula which as mentioned above is something new..<o:p></o:p>
=INDEX($I$2:$I$39,SMALL(IF($H$2:$H$39=$J2,ROW($H$2:$H$39)-ROW($H$2)+1),COUNTIF($J$2:J2,J2)),1)<o:p></o:p>
<o:p> </o:p>
. As before we try to determine how the row for a fairly normal INDEX Function is found<o:p></o:p>
. It would appear always useful to begin looking at fixed parts / array, and then see the effect of parts that change as dragged down.<o:p></o:p>
.<o:p></o:p>
. .h (i). The following <o:p></o:p>
ROW($H$2:$H$39)-ROW($H$2)+1<o:p></o:p>
gives a fixed array, effectively the “actual index” starting at 1 for the rows of interest<o:p></o:p>
{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38} <o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
This is pair wise IFed against an array of TRUE and FALSE given by $H$2:$H$39=$J_ The TRUE or FALSE refers sequentially to each $J_ going down the ordered rows . (In this case the $J_ is taken as its type / category ( a , b , c, d ) and again as in the first formula it does not give us the actual occurrence of that type of category.. ). A number is therefore given “ out “ at the TRUE points corresponding to the number in our actual index Array number for that row being looked at at the time given by the _ in $J_ and the entry FALSE is returned as is the case for a two argument IFcse Function ( see again from Post #6<o:p></o:p>
http://www.mrexcel.com/forum/excel-questions/855055-index-formula-expected-error-errors-sometimes-sometimes-returns-empty-cell-help-formula-expert-needed.html<o:p></o:p>
……)<o:p></o:p>
. This produced Array remains at the same size for all as we go down the rows. There are only 4 unique types of Array.: ( T = TRUE ; F = FALSE )<o:p></o:p>
<o:p> </o:p>
For a Array<o:p></o:p>
{T,T,F,T,T,F,T,T,T,F,F,F,F,T,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F}<o:p></o:p>
<o:p> </o:p>
For b Array<o:p></o:p>
{F,F,T,F,F,F,F,F,F,T,T,T,T,F,T,T,T,T,T,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F}<o:p></o:p>
<o:p> </o:p>
For c Array<o:p></o:p>
{F,F,F,F,F,T,F,F,F,F,F,F,F,F,F,F,F,F,F,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,F}<o:p></o:p>
<o:p> </o:p>
For d Array<o:p></o:p>
{F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,T}<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
So we have a corresponding “actual index” number at the occurrence effectively giving all their required row references to in an array. This is our first argument ( Look Up Table (Or grid or vertical 1 column Array) ) to be used in our 2 argument SMALL( . <o:p></o:p>
<o:p> </o:p>
For a<o:p></o:p>
{T,T,F,T,T,F,T,T,T,F,F,F,F, T ,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F}<o:p></o:p>
{1,2,F,4,5,F,7,8,9,F,F,F,F,14,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F}<o:p></o:p>
<o:p> </o:p>
For b<o:p></o:p>
{F,F,T,F,F,F,F,F,F, T , T , T , T ,F, T , T , T ,T , T ,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F}<o:p></o:p>
{F,F,3,F,F,F,F,F,F,10,11,12,13,F,15,16,17,18,19, F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F}<o:p></o:p>
<o:p> </o:p>
For c<o:p></o:p>
{F,F,F,F,F,T,F,F,F,F,F,F,F,F,F,F,F,F,F, T, T , T , T , T , T ,T, T ,T, T , T, T , T , T , T , T , T , T , F}<o:p></o:p>
{F,F,F,F,F,6,F,F,F,F,F,F,F,F,F,F,F,F,F, 20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37, F}<o:p></o:p>
<o:p> </o:p>
For d<o:p></o:p>
{F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F, T }<o:p></o:p>
{F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,38 }<o:p></o:p>
<o:p> </o:p>
. As we progress down the rows, the corresponding COUNTIF($J$2:J_,J_) increases the available range $J$2:J_, and if we have a TRUE match at this point we will take the next Nth smallest . This gives me the actual index for this next occurrence of the ordered a , b , c , or d<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
For a<o:p></o:p>
{T,T,F,T,T,F,T,T,T,F,F,F,F, T ,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F}<o:p></o:p>
{1,2,F,4,5,F,7,8,9,F,F,F,F,14,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F}<o:p></o:p>
<o:p> </o:p>
For b<o:p></o:p>
{F,F,T,F,F,F,F,F,F, T , T , T , T ,F, T , T , T ,T , T ,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F}<o:p></o:p>
{F,F,3,F,F,F,F,F,F,10,11,12,13,F,15,16,17,18,19, F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F}<o:p></o:p>
<o:p> </o:p>
For c<o:p></o:p>
{F,F,F,F,F,T,F,F,F,F,F,F,F,F,F,F,F,F,F, T, T , T , T , T , T ,T, T ,T, T , T, T , T , T , T , T , T , T , F}<o:p></o:p>
{F,F,F,F,F,6,F,F,F,F,F,F,F,F,F,F,F,F,F, 20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37, F}<o:p></o:p>
<o:p> </o:p>
For d<o:p></o:p>
{F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F, T }<o:p></o:p>
{F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,38 }<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
. Following the above logic I manually did the following ( I promise ! ) <o:p></o:p>
<o:p> </o:p>
[color=[/FONT]lightgrey]Using Excel 2007<o:p></o:p>[/COLOR]
[Table="width:, class:grid"]<o:p></o:p>
[tr][td]
Indicy Array used for pair wisecomparison​
[/td][td]
Column I value pairwised with Indicy Array toleft​
[/td][
td]
For a
[/td][td]
Nth Counted in a Array
[/td][td]
For a
[/td][td]
[/td][td]
For b
[/td][td]
Nth Counted in b Array
[/td][td]
For b
[/td][td]
[/td][td]
For c
[/td][td]
NthCounted in c Array
[/td][td]
For c
[/td][td]
[/td][td]
For d
[/td][td]
NthCounted in d Array
[/td][td]
For d
[/td][td]
arraybeing looked in given by column J​
[/td][td]
number returned bycount If​
[/td][td]
indicy corresponding to that Nth Count forthat array​
[/td][td]
column I selected foroutput​
[/td][/tr][tr][td]
1​
[/td][td]I2[/td][td]
T
[/td][td]
1
[/td][td]
1
[/td][td]
[/td][td]
F
[/td][td]
[/td][td]
F
[/td][td]
[/td][td]
F
[/td][td]
[/td][td]
F
[/td][td]
[/td][td]
F
[/td][td]
[/td][td]
F
[/td][td]
a​
[/td][td]
1​
[/td][td]
1​
[/td][td]
I2​
[/td][/tr][tr][td]
2​
[/td][td]I3[/td][td]
T​
[/td][td]
2​
[/td][td]
2​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
a​
[/td][td]
2​
[/td][td]
2​
[/td][td]
I3​
[/td][/tr][tr][td]
3​
[/td][td]I4[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
1​
[/td][td]
3​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
a​
[/td][td]
3​
[/td][td]
4​
[/td][td]
I5​
[/td][/tr][tr][td]
4​
[/td][td]I5[/td][td]
T​
[/td][td]
3​
[/td][td]
4​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
a​
[/td][td]
4​
[/td][td]
5​
[/td][td]
I6​
[/td][/tr][tr][td]
5​
[/td][td]I6[/td][td]
T​
[/td][td]
4​
[/td][td]
5​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
a​
[/td][td]
5​
[/td][td]
7​
[/td][td]
I8​
[/td][/tr][tr][td]
6​
[/td][td]I7[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
1​
[/td][td]
6​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
a​
[/td][td]
6​
[/td][td]
8​
[/td][td]
I9​
[/td][/tr][tr][td]
7​
[/td][td]I8[/td][td]
T​
[/td][td]
5​
[/td][td]
7​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
a​
[/td][td]
7​
[/td][td]
9​
[/td][td]
I10​
[/td][/tr][tr][td]
8​
[/td][td]I9[/td][td]
T​
[/td][td]
6​
[/td][td]
8​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
a​
[/td][td]
8​
[/td][td]
14​
[/td][td]
I15​
[/td][/tr][tr][td]
9​
[/td][td]I10[/td][td]
T​
[/td][td]
7​
[/td][td]
9​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
b​
[/td][td]
1​
[/td][td]
3​
[/td][td]
I4​
[/td][/tr][tr][td]
10​
[/td][td]I11[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
2​
[/td][td]
10​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
b​
[/td][td]
2​
[/td][td]
19​
[/td][td]
I11​
[/td][/tr][tr][td]
11​
[/td][td]I12[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
3​
[/td][td]
11​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
b​
[/td][td]
3​
[/td][td]
11​
[/td][td]
I12​
[/td][/tr][tr][td]
12​
[/td][td]I13[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
4​
[/td][td]
12​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
b​
[/td][td]
4​
[/td][td]
12​
[/td][td]
I13​
[/td][/tr][tr][td]
13​
[/td][td]I14[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
5​
[/td][td]
13​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
b​
[/td][td]
5​
[/td][td]
13​
[/td][td]
I14​
[/td][/tr][tr][td]
14​
[/td][td]I15[/td][td]
T​
[/td][td]
8​
[/td][td]
14​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
b​
[/td][td]
6​
[/td][td]
15​
[/td][td]
I16​
[/td][/tr][tr][td]
15​
[/td][td]I16[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
6​
[/td][td]
15​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
b​
[/td][td]
7​
[/td][td]
16​
[/td][td]
I17​
[/td][/tr][tr][td]
16​
[/td][td]I17[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
7​
[/td][td]
16​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
b​
[/td][td]
8​
[/td][td]
17​
[/td][td]
I18​
[/td][/tr][tr][td]
17​
[/td][td]I18[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
8​
[/td][td]
17​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
b​
[/td][td]
9​
[/td][td]
18​
[/td][td]
I19​
[/td][/tr][tr][td]
18​
[/td][td]I19[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
9​
[/td][td]
18​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
b​
[/td][td]
10​
[/td][td]
19​
[/td][td]
I20​
[/td][/tr][tr][td]
19​
[/td][td]I20[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
10​
[/td][td]
19​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
1​
[/td][td]
6​
[/td][td]
I7​
[/td][/tr][tr][td]
20​
[/td][td]I21[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
2​
[/td][td]
20​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
2​
[/td][td]
20​
[/td][td]
I21​
[/td][/tr][tr][td]
21​
[/td][td]I22[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
3​
[/td][td]
21​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
3​
[/td][td]
21​
[/td][td]
I22​
[/td][/tr][tr][td]
22​
[/td][td]I23[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
4​
[/td][td]
22​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
4​
[/td][td]
22​
[/td][td]
I23​
[/td][/tr][tr][td]
23​
[/td][td]I24[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
5​
[/td][td]
23​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
5​
[/td][td]
23​
[/td][td]
I24​
[/td][/tr][tr][td]
24​
[/td][td]I25[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
6​
[/td][td]
24​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
6​
[/td][td]
24​
[/td][td]
I25​
[/td][/tr][tr][td]
25​
[/td][td]I26[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
7​
[/td][td]
25​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
7​
[/td][td]
25​
[/td][td]
I26​
[/td][/tr][tr][td]
26​
[/td][td]I27[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
8​
[/td][td]
26​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
8​
[/td][td]
26​
[/td][td]
I27​
[/td][/tr][tr][td]
27​
[/td][td]I28[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
9​
[/td][td]
27​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
9​
[/td][td]
27​
[/td][td]
I28​
[/td][/tr][tr][td]
28​
[/td][td]I29[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
10​
[/td][td]
28​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
10​
[/td][td]
28​
[/td][td]
I29​
[/td][/tr][tr][td]
29​
[/td][td]I30[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
11​
[/td][td]
29​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
11​
[/td][td]
29​
[/td][td]
I30​
[/td][/tr][tr][td]
30​
[/td][td]I31[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
12​
[/td][td]
30​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
12​
[/td][td]
30​
[/td][td]
I31​
[/td][/tr][tr][td]
31​
[/td][td]I32[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
13​
[/td][td]
31​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
13​
[/td][td]
31​
[/td][td]
I32​
[/td][/tr][tr][td]
32​
[/td][td]I33[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
14​
[/td][td]
32​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
14​
[/td][td]
32​
[/td][td]
I33​
[/td][/tr][tr][td]
33​
[/td][td]I34[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
15​
[/td][td]
33​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
15​
[/td][td]
33​
[/td][td]
I34​
[/td][/tr][tr][td]
34​
[/td][td]I35[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
16​
[/td][td]
34​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
16​
[/td][td]
34​
[/td][td]
I35​
[/td][/tr][tr][td]
35​
[/td][td]I36[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
17​
[/td][td]
35​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
17​
[/td][td]
35​
[/td][td]
I36​
[/td][/tr][tr][td]
36​
[/td][td]I37[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
18​
[/td][td]
36​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
18​
[/td][td]
36​
[/td][td]
I37​
[/td][/tr][tr][td]
37​
[/td][td]I38[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
19​
[/td][td]
37​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
c​
[/td][td]
19​
[/td][td]
37​
[/td][td]
I38​
[/td][/tr][tr][td]
38​
[/td][td]I39[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
F​
[/td][td]
[/td][td]
T​
[/td][td]
1​
[/td][td]
38​
[/td][td]
d​
[/td][td]
1​
[/td][td]
38​
[/td][td]
I39​
[/td][/tr]<o:p></o:p>

[/table]
[Table="width:,class:grid"][tr][td]_Concatenatingh)[/td][/tr][/table]<o:p></o:p>
<o:p> </o:p>
… and the results tie up with those from the following formula, for which I have extended my habit to N , the reasons of which will be discussed in the next section..<o:p></o:p>
<o:p> </o:p>
INDEX($H$2:$N$39,SMALL(IF($H$2:$H$39=$J2,ROW($H$2:$H$39)-ROW($H$2)+1),COUNTIF($J$2:$J2,$J2)),2)<o:p></o:p>
<o:p> </o:p>
https://app.box.com/s/c990qzxqxcw1ptwl7ame71bha75x1m5g<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
.i) Minor mods incl. extending to > two columns. <o:p></o:p>
<o:p> </o:p>
i (i) , The formula from the last section has virtually no limit in the INDEX( Array size. We may extend it and so capture more columns if the original data has more than 2 columns.As example I use the last formula but placed in column N and with the column of INDEX set to 7 rather than 2. This catches the Column N and puts it reordered appropriately in column L to give the following results ( with some arbitrary new data in column N )<o:p></o:p><o:p> </o:p><o:p> </o:p>Using Excel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
H
[/td][td]
I
[/td][td]
J
[/td][td]
K
[/td][td]
L
[/td][td]
M
[/td][td]
N
[/td][td]
O
[/td][/tr][tr][td]
1
[/td][td]UngroupedCategory or Sort Box[/td][td]UngroupedPart Number[/td][td]Ordered Category or Sort Box[/td][td]Ordered PartNumber[/td][td][/td][td][/td][td][/td][td][/td][/tr][tr][td]
2
[/td][td]a[/td][td]I2[/td][td]a[/td][td]I2[/td][td]F-Tang[/td][td][/td][td]F-Tang[/td][td]I2| I3 | I5 | I6 | I8 | I9 | I10 | I15 |[/td][/tr][tr][td]
3
[/td][td]a[/td][td]I3[/td][td]a[/td][td]I3[/td][td]F-Tang[/td][td][/td][td]F-Tang[/td][td][/td][/tr][tr][td]
4
[/td][td]b[/td][td]I4[/td][td]a[/td][td]I5[/td][td]Wigy-Wam[/td][td][/td][td]OLE[/td][td][/td][/tr][tr][td]
5
[/td][td]a[/td][td]I5[/td][td]a[/td][td]I6[/td][td]Biscuit[/td][td][/td][td]Wigy-Wam[/td][td][/td][/tr][tr][td]
6
[/td][td]a[/td][td]I6[/td][td]a[/td][td]I8[/td][td]DuWolly[/td][td][/td][td]Biscuit[/td][td][/td][/tr][tr][td]
7
[/td][td]c[/td][td]I7[/td][td]a[/td][td]I9[/td][td]Wop[/td][td][/td][td]Barrel[/td][td][/td][/tr][tr][td]
8
[/td][td]a[/td][td]I8[/td][td]a[/td][td]I10[/td][td]I10[/td][td][/td][td]DuWolly[/td][td][/td][/tr][tr][td]
9
[/td][td]a[/td][td]I9[/td][td]a[/td][td]I15[/td][td]I15[/td][td][/td][td]Wop[/td][td][/td][/tr][tr][td]
10
[/td][td]a[/td][td]I10[/td][td]b[/td][td]I4[/td][td]OLE[/td][td][/td][td]I10[/td][td]I4| I11 | I12 | I13 | I14 | I16 | I17 | I18 | I19 | I20 |[/td][/tr][tr][td]
11
[/td][td]b[/td][td]I11[/td][td]b[/td][td]I11[/td][td]I11[/td][td][/td][td]I11[/td][td][/td][/tr][tr][td]
12
[/td][td]b[/td][td]I12[/td][td]b[/td][td]I12[/td][td]I12[/td][td][/td][td]I12[/td][td][/td][/tr][tr][td]
13
[/td][td]b[/td][td]I13[/td][td]b[/td][td]I13[/td][td]I13[/td][td][/td][td]I13[/td][td][/td][/tr][tr][td]
14
[/td][td]b[/td][td]I14[/td][td]b[/td][td]I14[/td][td]I14[/td][td][/td][td]I14[/td][td][/td][/tr][tr][td]
15
[/td][td]a[/td][td]I15[/td][td]b[/td][td]I16[/td][td]I16[/td][td][/td][td]I15[/td][td][/td][/tr][/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>

<o:p> </o:p>
<o:p> </o:p>
.. ( the barrel has rolled down to the c somewhere around row 20)<o:p></o:p>
<o:p> </o:p>
(ii) Extending Rows.. (`ere weg go 2 3 4 )<o:p></o:p>
. No real ill effects occur when extending the Rows in both Formulas, other than if the fist column is empty. There are probably endless ways to allow for this in the Formula, but I would suggests it is easier just to write something arbitrary in the empty cells such as “It is Empty” , preferably spelt with a z … --- ( zempty = is empty when I say it ! ) to get that sorted at the end, such as here.. <o:p></o:p>
<o:p> </o:p>
Using Excel 2007<o:p></o:p>
[Table="width:, class:grid"][tr][td]-[/td][td]
H
[/td][td]
I
[/td][td]
J
[/td][td]
K
[/td][td]
L
[/td][td]
M
[/td][td]
N
[/td][td]
O
[/td][/tr][tr][td]
38
[/td][td]c[/td][td]I38[/td][td]c[/td][td]I38[/td][td][/td][td][/td][td]I38[/td][td][/td][/tr][tr][td]
39
[/td][td]d[/td][td]I39[/td][td]d[/td][td]I39[/td][td][/td][td][/td][td]I39[/td][td]I39[/td][/tr][tr][td]
40
[/td][td]Zempty[/td][td][/td][td]Zempty[/td][td]
0​
[/td][td][/td][td][/td][td][/td][td]0| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |[/td][/tr][tr][td]
41
[/td][td]Zempty[/td][td][/td][td]Zempty[/td][td]
0​
[/td][td][/td][td][/td][td][/td][td][/td][/tr][/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>

<o:p> </o:p>
https://app.box.com/s/b0k3jeamyb7mml4o4jlgd4168vb9s3z5<o:p></o:p>
<o:p> </o:p>
.j) Further consolidation of grouping formulas into main formulas.. <o:p></o:p>
<o:p> </o:p>
The idea here is relatively straight forward. The final large concatenating formulas from section .f) works with the sorted data in spreadsheet rows J and K . Sections .g) - i) were used to take possibly unsorted data and sort / group it as this format was needed for the large concatenating formulas. The idea here was to simply replace reference to Columns J to K with the formulas working with the unsorted data in columns H and I .. - So effectively referencing directly the unsorted raw data from columns H and I. Simple idea, somewhat tedious to do, but I was spared the misery anyway as it did / will not work.. I got this far for example bringing the formula in the J column rather than the value in the J column …….<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p>
Using Excel 2007<o:p></o:p>
[Table="width:, class:grid"]<o:p></o:p>
[tr][td]=SUBSTITUTE(IF(OR(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=$J1,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234), 0),2)=""),"",INDEX(IF(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234), 0),2)=$I2:$J$234,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2):$K$234,""),1,2) & " |") &IF(OR(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=$J1,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=""),"",INDEX(IF(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=$I2:$J$234,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2):$K$234,""),2,2) & " |") &IF(OR(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=$J1,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)), COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=""),"",INDEX(IF(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234, "<"&$H$2:$H$234),0),2)=$I2:$J$234,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2):$K$234,""),3,2) & " |") &IF(OR(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=$J1,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=""),"",INDEX(IF(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234), 0),2)=$I2:$J$234,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2):$K$234,""),4,2) & " |") &IF(OR(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234, "<"&$H$2:$H$234),0),2)=$J1,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=""),"",INDEX(IF(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)), COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=$I2:$J$234,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2):$K$234,""),5,2) & " |") & IF(OR(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234), 0),2)=$J1,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=""),"",INDEX(IF(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=$I2:$J$234,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)), COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2):$K$234,""),6,2) & " |") &IF(OR(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=$J1,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=""),"",INDEX(IF(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=$I2:$J$234,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2):$K$234,""),7,2) & " |") &IF(OR(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234), 0),2)=$J1,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)), COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=""),"",INDEX(IF(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=$I2:$J$234,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2):$K$234,""),8,2) & " |") & IF(OR(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234), 0),2)=$J1,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234, "<"&$H$2:$H$234),0),2)=""),"",INDEX(IF(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=$I2:$J$234,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2):$K$234,""),9,2) & " |") & IF(OR(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)), COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=$J1,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=""),"",INDEX(IF(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=$I2:$J$234,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234), 0),2):$K$234,""),10,2)& " | ") &IF(OR(INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=$J1,INDEX($G$2:$I$234,MATCH(SMALL(COUNTIF($H$2:$H$234,""& "<"&""&$H$2:$H$234&""),ROWS($J$1:$J1)),COUNTIF($H$2:$H$234,"<"&$H$2:$H$234),0),2)=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),11,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),12,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),13,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),14,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),15,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),16,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),17,2)& " | ") &IF(OR($J2=$J1,$J2=""),"",INDEX(IF($J2=$I2:$J$234,$J2:$K$234,""),18,2)& " | ")," | | ","")[/td][/tr]<o:p></o:p>
[/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>
<o:p> </o:p>
……. Then I hit a character limit of 8192 in the formula length. <o:p></o:p>
<o:p> </o:p>
https://app.box.com/s/v0g01iray6hs2lf1nlkhhser7v8b2f4k<o:p></o:p>
<o:p> </o:p>
. Still it was a Nutty idea anyway, and we will proceed further with formulas to the left of column N as per the original 2 section idea from the start of this Rambling and see what happens..<o:p></o:p>
.<o:p></o:p>
. I will reserve Column N for the final required Output. Correspondingly I shall reserve Column L an M for the actual Raw data.<o:p></o:p>
<o:p> </o:p>
.K) Uniques column.. <o:p></o:p>
<o:p> </o:p>
. Usually for such a requirement the unique categories will be require. Indeed we have done this within the past few sorting / grouping formulas. Here we will specifically produce a table of 4 n rows correspond to n unique categories. ( In our example n = 4 , but the formula, as always will be developed to handle a undetermined number within the total table size (….. 2 3 4 )<o:p></o:p>
<o:p> </o:p>
.. I lift the formula from post #32 here:<o:p></o:p>
http://www.mrexcel.com/forum/excel-questions/818208-code-move-vertical-horizontal-4.html<o:p></o:p>
… adapted to give a unique list in our example so…<o:p></o:p>
<o:p> </o:p>
Using Excel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
H
[/td][td]
I
[/td][td]
J
[/td][td]
K
[/td][td]
L
[/td][/tr][tr][td]
1
[/td][td]UngroupedCategory or Sort Box[/td][td]UngroupedPart Number[/td][td]Ordered Category or Sort Box[/td][td]Ordered Part Number[/td][td]
UniqueNumbers​
[/td][/tr][tr][td]
2
[/td][td]a[/td][td]I2[/td][td]a[/td][td]I2[/td][td]a[/td][/tr][tr][td]
3
[/td][td]a[/td][td]I3[/td][td]a[/td][td]I3[/td][td]b[/td][/tr][tr][td]
4
[/td][td]b[/td][td]I4[/td][td]a[/td][td]I5[/td][td]c[/td][/tr][tr][td]
5
[/td][td]a[/td][td]I5[/td][td]a[/td][td]I6[/td][td]d[/td][/tr][tr][td]
6
[/td][td]a[/td][td]I6[/td][td]a[/td][td]I8[/td][td]Zempty[/td][/tr][tr][td]
7
[/td][td]c[/td][td]I7[/td][td]a[/td][td]I9[/td][td][/td][/tr][tr][td]
8
[/td][td]a[/td][td]I8[/td][td]a[/td][td]I10[/td][td][/td][/tr][tr][td]
9
[/td][td]a[/td][td]I9[/td][td]a[/td][td]I15[/td][td][/td][/tr][tr][td]
10
[/td][td]a[/td][td]I10[/td][td]b[/td][td]I4[/td][td][/td][/tr][tr][td]
11
[/td][td]b[/td][td]I11[/td][td]b[/td][td]I11[/td][td][/td][/tr][tr][td]
12
[/td][td]b[/td][td]I12[/td][td]b[/td][td]I12[/td][td][/td][/tr][tr][td]
13
[/td][td]b[/td][td]I13[/td][td]b[/td][td]I13[/td][td][/td][/tr][tr][td]
14
[/td][td]b[/td][td]I14[/td][td]b[/td][td]I14[/td][td][/td][/tr][tr][td]
15
[/td][td]a[/td][td]I15[/td][td]b[/td][td]I16[/td][td][/td][/tr][tr][td]
16
[/td][td]b[/td][td]I16[/td][td]b[/td][td]I17[/td][td][/td][/tr][tr][td]
17
[/td][td]b[/td][td]I17[/td][td]b[/td][td]I18[/td][td][/td][/tr][tr][td]
18
[/td][td]b[/td][td]I18[/td][td]b[/td][td]I19[/td][td][/td][/tr][tr][td]
19
[/td][td]b[/td][td]I19[/td][td]b[/td][td]I20[/td][td][/td][/tr][tr][td]
20
[/td][td]b[/td][td]I20[/td][td]c[/td][td]I7[/td][td][/td][/tr][tr][td]
21
[/td][td]c[/td][td]I21[/td][td]c[/td][td]I21[/td][td][/td][/tr][tr][td]
22
[/td][td]c[/td][td]I22[/td][td]c[/td][td]I22[/td][td][/td][/tr][tr][td]
23
[/td][td]c[/td][td]I23[/td][td]c[/td][td]I23[/td][td][/td][/tr][tr][td]
24
[/td][td]c[/td][td]I24[/td][td]c[/td][td]I24[/td][td][/td][/tr][tr][td]
25
[/td][td]c[/td][td]I25[/td][td]c[/td][td]I25[/td][td][/td][/tr][tr][td]
26
[/td][td]c[/td][td]I26[/td][td]c[/td][td]I26[/td][td][/td][/tr][tr][td]
27
[/td][td]c[/td][td]I27[/td][td]c[/td][td]I27[/td][td][/td][/tr][tr][td]
28
[/td][td]c[/td][td]I28[/td][td]c[/td][td]I28[/td][td][/td][/tr][tr][td]
29
[/td][td]c[/td][td]I29[/td][td]c[/td][td]I29[/td][td][/td][/tr][tr][td]
30
[/td][td]c[/td][td]I30[/td][td]c[/td][td]I30[/td][td][/td][/tr][tr][td]
31
[/td][td]c[/td][td]I31[/td][td]c[/td][td]I31[/td][td][/td][/tr][tr][td]
32
[/td][td]c[/td][td]I32[/td][td]c[/td][td]I32[/td][td][/td][/tr][tr][td]
33
[/td][td]c[/td][td]I33[/td][td]c[/td][td]I33[/td][td][/td][/tr][tr][td]
34
[/td][td]c[/td][td]I34[/td][td]c[/td][td]I34[/td][td][/td][/tr][tr][td]
35
[/td][td]c[/td][td]I35[/td][td]c[/td][td]I35[/td][td][/td][/tr][tr][td]
36
[/td][td]c[/td][td]I36[/td][td]c[/td][td]I36[/td][td][/td][/tr][tr][td]
37
[/td][td]c[/td][td]I37[/td][td]c[/td][td]I37[/td][td][/td][/tr][tr][td]
38
[/td][td]c[/td][td]I38[/td][td]c[/td][td]I38[/td][td][/td][/tr][tr][td]
39
[/td][td]d[/td][td]I39[/td][td]d[/td][td]I39[/td][td][/td][/tr][tr][td]
40
[/td][td]Zempty[/td][td][/td][td]Zempty[/td][td][/td][td][/td][/tr]<o:p></o:p>

[/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>
<o:p> </o:p>
….. would be<o:p></o:p>
<o:p> </o:p>
=IFERROR(INDEX( $J$2:$J$234 , MATCH(0, COUNTIF($L$1:$L1, $J$2:$J$234), 0) ,1 ),"")<o:p></o:p>
<o:p> </o:p>
. The main part here is a relatively simple INDEX( and I have dropped my “habit” a bit for this one, remaining with the penultimate simplified 1 column required, but also including it ,1 which as mentioned previously is the default and so could have been omitted. <o:p></o:p>
. Cearly the grid (Range) of interest here is the one with all values from which we wish to determine the unique which in is our Column J . The entire column then is our reference, as noted the column is set to 1, the only one, and we are looking for a way to row indices such that we will return just once the values a b c d ( zempty is also here but we will worry about that later. ) <o:p></o:p>
.<o:p></o:p>
. I will put into words exactly wot ( I think ) is happening, then try to explain that. In each line, the will return a co ordinate equal to the row in the main column $J$2:$J$234 in which the first time it encounters a row in which all the unique values found so far in addition to that the value of $L1 currently in this row ( whether or not that is already a found unique value or not ) is not found. Effectively that gives us the first occurrence of the value from $L1 <o:p></o:p>
. Helpful here I think will be to include a second formula almost identical but to work on the Unordered Category list and produce the output in Column M. The results are this<o:p></o:p>
<o:p> </o:p>
Using Excel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
H
[/td][td]
I
[/td][td]
J
[/td][td]
K
[/td][td]
L
[/td][td]
M
[/td][/tr][tr][td]
1
[/td][td]UngroupedCategory or Sort Box[/td][td]UngroupedPart Number[/td][td]Ordered Category or Sort Box[/td][td]Ordered Part Number[/td][td]
Unique from OrderedCategory​
[/td][td]
Unique from UnorderedCategory​
[/td][/tr][tr][td]
2
[/td][td]a[/td][td]I2[/td][td]a[/td][td]I2[/td][td]a[/td][td]a[/td][/tr][tr][td]
3
[/td][td]a[/td][td]I3[/td][td]a[/td][td]I3[/td][td]b[/td][td]b[/td][/tr][tr][td]
4
[/td][td]b[/td][td]I4[/td][td]a[/td][td]I5[/td][td]c[/td][td]c[/td][/tr][tr][td]
5
[/td][td]a[/td][td]I5[/td][td]a[/td][td]I6[/td][td]d[/td][td]d[/td][/tr][tr][td]
6
[/td][td]a[/td][td]I6[/td][td]a[/td][td]I8[/td][td][/td][td][/td][/tr]<o:p></o:p>

[/table]
[Table="width:, class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>
<o:p> </o:p>
… and it is a bit more easy to explain looking at a formula pair a little way down, such as<o:p></o:p>
<o:p> </o:p>
Using Excel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
L
[/td][td]
M
[/td][/tr][tr][td]
4
[/td][td]=IFERROR(INDEX($J$2:$J$39,MATCH(0,COUNTIF($L$1:$L3,$J$2:$J$39),0),1),"")[/td][td]=IFERROR(INDEX($H$2:$H$39,MATCH(0,COUNTIF($M$1:$M3,$H$2:$H$39),0),1),"")[/td][/tr]<o:p></o:p>

[/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>
<o:p> </o:p>
.. formulas again <o:p></o:p>
<o:p> </o:p>
( …..The minor mod reducing of 234 to 39 is not important just now, it is just done to simplify showing the main Look Up Table (Column used both the INDEX and MATCH , that is to say <o:p></o:p>
$J$2:$J$39 = {"a","a","a","a","a","a","a","a","b","b","b","b","b","b","b","b","b","b","c","c","c","c","c","c","c","c","c","c","c","c","c","c","c","c","c","c","c","d"} <o:p></o:p>
$H$2:$H$39 = <o:p></o:p>
{"a";"a";"b";"a";"a";"c";"a";"a";"a";"b";"b";"b";"b";"a";"b";"b";"b";"b";"b";"c";"c";"c";"c";"c";"c";"c";"c";"c";"c";"c";"c";"c";"c";"c";"c";"c";"c";"d"}<o:p></o:p>
….. )<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p>
=IFERROR(INDEX($J$2:$J$39, MATCH(0, COUNTIF($L$1:$L3,$J$2:$J$39), 0),1),"")<o:p></o:p>
<o:p> </o:p>
=IFERROR(INDEX($H$2:$H$39, MATCH(0, COUNTIF($M$1:$M3,$H$2:$H$39), 0),1),"")<o:p></o:p>
<o:p> </o:p>
.. highlighting either $L$1:$L3 or $M$1:$M3 and doing the F9 in the formula Bar trick gives the same:<o:p></o:p>
{ "Unique from Ordered Category" , "a" , "b" } <o:p></o:p>
<o:p> </o:p>
. Taking this all a bit further you will see:<o:p></o:p>
for the first formula gives for the entire COUNTIF statement returns<o:p></o:p>
{1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0} <o:p></o:p>
So that the MATCH for a position going down of a 0 is ( 0 is from the MATCH argument what is being looked for ) the co ordinate 19. <o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
for the second formula gives for the entire COUNTIF statement returns<o:p></o:p>
{1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1;1;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0} <o:p></o:p>
So that the MATCH for a position going down of a 0 is the co ordinate 6. <o:p></o:p>
<o:p> </o:p>
. Either of these two co ordinates working with their respective Arrays return the c as at the row where the is unable to count an a or a b .<o:p></o:p>
. Important Point here is that COUNTIF with multiple criteria in the first argument counts for either row by row, similar to how VBA and Excel generally works for filtered searches…<o:p></o:p>
<o:p> </o:p>
https://app.box.com/s/gxpu06pwmxttybmkp92g83aj7v54hf6q<o:p></o:p>
<o:p> </o:p>
.l) Consolidating formulas to remove some columns.. <o:p></o:p>
<o:p> </o:p>
. Typically at this point the reference to various Columns in Formulas could be replaced by the actual formula within that any Particular column. That particular column could then be removed. . This proves to be impossible in this case as most formulas in a column refer to cells within that column. So it would never be possible to remove them by the method above and then delete them. In addition although generally one can replace a cell reference by the formula in that cell, I do not think it is as straight forward to replace a cell reference by the formula in that cell if that cell reference is used as part of a Range reference.. ?? <o:p></o:p>
. In any case it is probably better to include all of these “Help” columns for later flexibility for different forms of the raw data, as well as keeping everything easier to follow later. As it is not possible, for example to “consolidate away” the Uniques column, the start point for the next section will be the following, where the unique columns are shifted to the left as we are trying to reserve Columns L and M for the Raw data<o:p></o:p>
<o:p> </o:p>
Using Excel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
F
[/td][td]
G
[/td][td]
H
[/td][td]
I
[/td][td]
J
[/td][td]
K
[/td][td]
L
[/td][td]
M
[/td][td]
N
[/td][/tr][tr][td]
1
[/td][td]
Uniquefrom Ordered Category​
[/td][td]
Unique from UnOrderedCategory​
[/td][td]Ungrouped Category or Sort Box[/td][td]Ungrouped Part Number[/td][td]Ordered Category or Sort Box[/td][td]Ordered PartNumber[/td][td]
[/td][td]
[/td][td][/td][/tr][tr][td]
2
[/td][td]a[/td][td]a[/td][td]a[/td][td]I2[/td][td]a[/td][td]I2[/td][td][/td][td][/td][td]I2| I3 | I5 | I6 | I8 | I9 | I10 | I15 |[/td][/tr][tr][td]
3
[/td][td]b[/td][td]b[/td][td]a[/td][td]I3[/td][td]a[/td][td]I3[/td][td][/td][td][/td][td]I4| I11 | I12 | I13 | I14 | I16 | I17 | I18 | I19 | I20 |[/td][/tr][tr][td]
4
[/td][td]c[/td][td]c[/td][td]b[/td][td]I4[/td][td]a[/td][td]I5[/td][td][/td][td][/td][td]I7| I21 | I22 | I23 | I24 | I25 | I26 | I27 | I28 | I29 | I30 | I31 | I32 | I33 |I34 | I35 | I36 | I37 |[/td][/tr][tr][td]
5
[/td][td]d[/td][td]d[/td][td]a[/td][td]I5[/td][td]a[/td][td]I6[/td][td][/td][td][/td][td]I39[/td][/tr][tr][td]
6
[/td][td]Zempty[/td][td]Zempty[/td][td]a[/td][td]I6[/td][td]a[/td][td]I8[/td][td][/td][td][/td][td][/td][/tr][tr][td]
7
[/td][td][/td][td][/td][td]c[/td][td]I7[/td][td]a[/td][td]I9[/td][td][/td][td][/td][td][/td][/tr]<o:p></o:p>

[/table]
[Table="width:,class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>
<o:p> </o:p>
https://app.box.com/s/qjcy1yaae8pgpy3r8dw8qx329dloa0xp<o:p></o:p>
<o:p> </o:p>
.m) Removing blank cells in Final List for concatenated values.. <o:p></o:p>
<o:p> </o:p>
. This would be typically be the final form of the required output. So we will aim to put this in Column N. <o:p></o:p>
. This step can be satisfied with a fairly simple VLookUp Formula:<o:p></o:p>
. This would take as its first argument ( The Look Up Value ) as that given that from either of the Uniques categories column, the second argument ( The Look Up Table ) would be any range Including the Ordered Categories Column (As the VLookUp Function takes the first column as where it searches for the first argument ( The Look Up Value ). <o:p></o:p>
This range then needs to extend into our required output which is the Concatenated results. This would be the sixth Column along from the Look Up Value Column.<o:p></o:p>
. So this is one formula that does the trick. Formula does the trick.( It does not need to be CSE entered, but I have done so in case I do manage at a later date to consolidate by replacing cell references within this formula by the formulas in those cells which maybe CSE entered. )<o:p></o:p>
<o:p> </o:p>
Using Excel 2007<o:p></o:p>
[Table="width:, class:grid"][tr][td]-[/td][td]
N
[/td][/tr][tr][td]
2
[/td][td]=IFERROR(VLOOKUP(G2,$J$2:$O$234,6,FALSE),"")[/td][/tr]<o:p></o:p>

[/table]
[Table="width:, class:grid"][tr][td]FMExplain(2003)[/td][/tr][/table]<o:p></o:p>
<o:p> </o:p>
=IFERROR(VLOOKUP(G2,$J$2:$O$234,6,FALSE),"")<o:p></o:p>
<o:p> </o:p>
I have dropped my habit here as the selected range is already a bit wide. So have only extended as far as I have to , that is to say to the sixth Row.<o:p></o:p>
. Finaly an IFERROR is tacked on simply to as an error is caused when we overshot downwards with the formula past the Look Up Values (The final argument FALSE stipulates an exact entry but the formula appears to work with TRUE also.)<o:p></o:p>
. ( Luckily, by default, the formula only gives us the first match and not multiple answers )<o:p></o:p>
<o:p> </o:p>
. That is more or less it ( I think )<o:p></o:p>
<o:p> </o:p>
https://app.box.com/s/w4xr4webks98kgt6ydzti7kttqii0ca8<o:p></o:p>
<o:p> </o:p>
.n) Application to an example <o:p></o:p>
<o:p> </o:p>
. Here a quick go at applying specifically to an example.<o:p></o:p>
. Start Point would be to have the two column of raw data in columns L to M thus.<o:p></o:p>
<o:p> </o:p>
. Using Excel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
L
[/td][td]
M
[/td][/tr][tr][td]
1
[/td][td]
RawData​
[/td][td]
Raw Data​
[/td][/tr][tr][td]
2
[/td][td]F4506[/td][td]F126739347.jpg[/td][/tr][tr][td]
3
[/td][td]F4506[/td][td]F126839347.jpg[/td][/tr][tr][td]
4
[/td][td]F4506[/td][td]F146739270.jpg[/td][/tr][tr][td]
5
[/td][td]F4506[/td][td]F146739347.jpg[/td][/tr][tr][td]
6
[/td][td]F4506[/td][td]F146839270.jpg[/td][/tr][tr][td]
7
[/td][td]F4506[/td][td]F146839347.jpg[/td][/tr][tr][td]
8
[/td][td]F4506[/td][td]F4506.jpg[/td][/tr][tr][td]
9
[/td][td]F4506[/td][td]F4506BACK.jpg[/td][/tr][tr][td]
10
[/td][td]F4506[/td][td]F4506SOLE.jpg[/td][/tr][tr][td]
11
[/td][td]F4506[/td][td]F4507.jpg[/td][/tr][tr][td]
12
[/td][td]F4506[/td][td]F4507BACK.jpg[/td][/tr][tr][td]
13
[/td][td]F4506[/td][td]F4507SOLE.jpg[/td][/tr][tr][td]
14
[/td][td]F4506[/td][td]F4508.jpg[/td][/tr][tr][td]
15
[/td][td]F4506[/td][td]F4508BACK.jpg[/td][/tr][tr][td]
16
[/td][td]F4506[/td][td]F4508SOLE.jpg[/td][/tr][tr][td]
17
[/td][td]F4506[/td][td]F4509.jpg[/td][/tr][tr][td]
18
[/td][td]F4506[/td][td]F4509BACK.jpg[/td][/tr][tr][td]
19
[/td][td]F4506[/td][td]F4509SOLE.jpg[/td][/tr][tr][td]
20
[/td][td]F4506[/td][td]F4510.jpg[/td][/tr][tr][td]
21
[/td][td]F4506[/td][td]F4510BACK.jpg[/td][/tr][tr][td]
22
[/td][td]F4506[/td][td]F4510SOLE.jpg[/td][/tr][tr][td]
23
[/td][td]F4506[/td][td]F4511.jpg[/td][/tr][tr][td]
24
[/td][td]F4506[/td][td]F4511BACK.jpg[/td][/tr][tr][td]
25
[/td][td]F4506[/td][td]F4511SOLE.jpg[/td][/tr][tr][td]
26
[/td][td]F4506[/td][td]F4512.jpg[/td][/tr][tr][td]
27
[/td][td]F4506[/td][td]F4512BACK.jpg[/td][/tr][tr][td]
28
[/td][td]F4506[/td][td]F4512SOLE.jpg[/td][/tr][tr][td]
29
[/td][td]F4506[/td][td]F4514.jpg[/td][/tr][tr][td]
30
[/td][td]F4506[/td][td]F4514BACK.jpg[/td][/tr][tr][td]
31
[/td][td]F4506[/td][td]F4514SOLE.jpg[/td][/tr][tr][td]
32
[/td][td]F4506[/td][td]F511546001[/td][/tr][tr][td]
33
[/td][td]F4506[/td][td]F511546001.jpg[/td][/tr][tr][td]
34
[/td][td]F4506[/td][td]F511546221.jpg[/td][/tr][tr][td]
35
[/td][td]F4506[/td][td]F511546388.jpg[/td][/tr][tr][td]
36
[/td][td]F4506[/td][td]F520112001.jpg[/td][/tr][tr][td]
37
[/td][td]F4506[/td][td]F520112250.jpg[/td][/tr][tr][td]
38
[/td][td]F4506[/td][td]F520112320.jpg[/td][/tr][tr][td]
39
[/td][td]F4507[/td][td]F520112330.jpg[/td][/tr]<o:p></o:p>

[/table]
[Table="width:,class:grid"][tr][td]FormulaSheet[/td][/tr][/table]<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
. Because of some of a) the consolidation problems mentioned in ; b) the general complexity of the formulas ; c) to make the general solution flexible and finally ; d) as the final requirements were not 100 % clear to me … I propose keeping all the columns as they are. Indeed I have added two extra “”Help” columns, a Third Uniques in Column E which uses the original OP data from his Column A ( Product ID ) , and a column to get the first 5 characters from the<o:p></o:p>
Original OP data Column B ( Product Image(s) ).<o:p></o:p>
. I further propose as a good idea generally for such solutions to keep all the formulas and workings on an extra sheet, called for example FormulaSheet. An additional Main sheet would then be kept in exactly the required format. <o:p></o:p>
. Formula Sheet would then access the raw data thus with very simple formulas,<o:p></o:p>
<o:p> </o:p>
Using Excel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
L
[/td][td]
M
[/td][/tr][tr][td]
1
[/td][td]
RawData​
[/td][td]
RawData​
[/td][/tr][tr][td]
2
[/td][td]=MainSheet!$A2[/td][td]=MainSheet!$B2[/td][/tr][tr][td]
3
[/td][td]=MainSheet!$A3[/td][td]=MainSheet!$B3[/td][/tr][tr][td]
4
[/td][td]=MainSheet!$A4[/td][td]=MainSheet!$B4[/td][/tr][tr][td]
5
[/td][td]=MainSheet!$A5[/td][td]=MainSheet!$B5[/td][/tr]<o:p></o:p>

[/table]
[Table="width:,class:grid"][tr][td]FormulaSheet[/td][/tr][/table]<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
And similarly the Main sheet would have one simple formula in each row thus<o:p></o:p>
<o:p> </o:p>
Using Excel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
A
[/td][td]
B
[/td][td]
C
[/td][/tr][tr][td]
1
[/td][td]
ProductID
[/td][td]
ProductImage(s)
[/td][td]All Product Images for ProductID[/td][/tr][tr][td]
2
[/td][td]F4506[/td][td]F126739347.jpg[/td][td]=FormulaSheet!$N2[/td][/tr][tr][td]
3
[/td][td]F4506[/td][td]F126839347.jpg[/td][td]=FormulaSheet!$N3[/td][/tr][tr][td]
4
[/td][td]F4506[/td][td]F146739270.jpg[/td][td]=FormulaSheet!$N4[/td][/tr][tr][td]
5
[/td][td]F4506[/td][td]F146739347.jpg[/td][td]=FormulaSheet!$N5[/td][/tr]<o:p></o:p>

[/table]
[Table="width:,class:grid"][tr][td]MainSheet[/td][/tr][/table]<o:p></o:p>
<o:p> </o:p>
. The exact results I achieve are this:<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
Using Excel 2007<o:p></o:p>
[Table="width:,class:grid"][tr][td]-[/td][td]
A
[/td][td]
B
[/td][td]
C
[/td][/tr]<o:p></o:p>

[tr][td]
1
[/td][td]
ProductID
[/td][td]
Product Image(s)
[/td][td]AllProduct Images for Product ID[/td][/tr]<o:p></o:p>

<o:p> </o:p>
[tr][td]
2
[/td][td]F4506[/td][td]F126739347.jpg[/td][td]F4506.jpg| F4506BACK.jpg | F4506SOLE.jpg[/td][/tr][tr][td]
3
[/td][td]F4506[/td][td]F126839347.jpg[/td][td]F4507.jpg| F4507BACK.jpg |F4507SOLE.jpg[/td][/tr][tr][td]
4
[/td][td]F4506[/td][td]F146739270.jpg[/td][td][/td][/tr][tr][td]
5
[/td][td]F4506[/td][td]F146739347.jpg[/td][td][/td][/tr][tr][td]
6
[/td][td]F4506[/td][td]F146839270.jpg[/td][td][/td][/tr][tr][td]
7
[/td][td]F4506[/td][td]F146839347.jpg[/td][td][/td][/tr][tr][td]
8
[/td][td]F4506[/td][td]F4506.jpg[/td][td][/td][/tr][tr][td]
9
[/td][td]F4506[/td][td]F4506BACK.jpg[/td][td][/td][/tr][tr][td]
10
[/td][td]F4506[/td][td]F4506SOLE.jpg[/td][td][/td][/tr][tr][td]
11
[/td][td]F4506[/td][td]F4507.jpg[/td][td][/td][/tr]<o:p></o:p>

[/table]
[Table="width:,class:grid"][tr][td]MainSheet[/td][/tr][/table]<o:p></o:p>
<o:p> </o:p>
. The complete set of formulas ( not all of which are used in this case, but I include for completeness as they are explained in detail above and may be needed for minor modifications for this or other similar applications.<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p>
. The entire row of formulas needs to be dragged down all rows.. ( For no particular reason I have set the maximum size for now to 234 rows. <o:p></o:p>
<o:p> </o:p>
. <b>Excel 2007</b><table width="1" cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /><col /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>J</th><th>K</th><th>L</th><th>M</th><th>N</th><th>O</th><th>E</th><th>F</th><th>G</th><th>H</th><th>I</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">Ordered Category or  Sort Box</td><td style=";">Ordered Part Number</td><td style="text-align: center;;">Raw Data</td><td style="text-align: center;;">Raw Data</td><td style=";">Required output</td><td style="text-align: right;;"></td><td style="text-align: center;;">Unique from Column L ( OP Column A )</td><td style="text-align: center;;">Unique from Ordered Category</td><td style="text-align: center;;">Unique from UnOrdered Category</td><td style=";">Ungrouped Category or  Sort Box</td><td style=";">Ungrouped Part Number</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style=";">F1267</td><td style=";">F126739347.jpg</td><td style="background-color: #FFFF00;;">F4506</td><td style=";">F126739347.jpg</td><td style=";">F4506.jpg | F4506BACK.jpg | F4506SOLE.jpg</td><td style="background-color: #F0F5E7;;">F126739347.jpg</td><td style=";">F4506</td><td style=";">F1267</td><td style=";">F1267</td><td style=";">F1267</td><td style=";">F126739347.jpg</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style=";">F1268</td><td style=";">F126839347.jpg</td><td style=";">F4506</td><td style=";">F126839347.jpg</td><td style=";">F4507.jpg | F4507BACK.jpg | F4507SOLE.jpg</td><td style="background-color: #F0F5E7;;">F126839347.jpg</td><td style=";">F4507</td><td style=";">F1268</td><td style=";">F1268</td><td style=";">F1268</td><td style=";">F126839347.jpg</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style=";">F1467</td><td style=";">F146739270.jpg</td><td style=";">F4506</td><td style=";">F146739270.jpg</td><td style=";"></td><td style="background-color: #F0F5E7;;">F146739270.jpg | F146739347.jpg | </td><td style=";"></td><td style=";">F1467</td><td style=";">F1467</td><td style=";">F1467</td><td style=";">F146739270.jpg</td></tr></tbody></table><p style="width:7,2em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">FormulaSheet</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">H2</th><td style="text-align:left">=LEFT(<font color="Blue">M2,5</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">I2</th><td style="text-align:left">=M2</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">L2</th><td style="text-align:left">=MainSheet!$A2</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">M2</th><td style="text-align:left">=MainSheet!$B2</td></tr></tbody></table></td></tr></table><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Array Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">E2</th><td style="text-align:left">{=IFERROR(<font color="Blue">INDEX(<font color="Red">$L$2:$L$234, MATCH(<font color="Green">0, COUNTIF(<font color="Purple">$E$1:$E1,$L$2:$L$234</font>), 0</font>),1</font>),""</font>)}</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">F2</th><td style="text-align:left">{=IFERROR(<font color="Blue">INDEX(<font color="Red">$J$2:$J$234, MATCH(<font color="Green">0, COUNTIF(<font color="Purple">$G$1:$G1,$J$2:$J$234</font>), 0</font>),1</font>),""</font>)}</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">G2</th><td style="text-align:left">{=IFERROR(<font color="Blue">INDEX(<font color="Red">$H$2:$H$234, MATCH(<font color="Green">0, COUNTIF(<font color="Purple">$G$1:$G1,$H$2:$H$234</font>), 0</font>),1</font>),""</font>)}</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">J2</th><td style="text-align:left">{=INDEX(<font color="Blue">$G$2:$I$234, MATCH(<font color="Red">SMALL(<font color="Green">COUNTIF(<font color="Purple">$H$2:$H$234,"" & "<"&""&$H$2:$H$234&""</font>), ROWS(<font color="Purple">$J$1:$J1</font>)</font>), COUNTIF(<font color="Green">$H$2:$H$234, "<"&$H$2:$H$234</font>), 0</font>),2</font>)}</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">K2</th><td style="text-align:left">{=INDEX(<font color="Blue">$H$2:$N$234,SMALL(<font color="Red">IF(<font color="Green">$H$2:$H$234=$J2,ROW(<font color="Purple">$H$2:$H$234</font>)-ROW(<font color="Purple">$H$2</font>)+1</font>),COUNTIF(<font color="Green">$J$2:$J2,$J2</font>)</font>),2</font>)}</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">N2</th><td style="text-align:left">{=IFERROR(<font color="Blue">VLOOKUP(<font color="Red">E2,$J$2:$O$234,6,FALSE</font>),""</font>)}</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">O2</th><td style="text-align:left">{=SUBSTITUTE(<font color="Blue">IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),1,2</font>) & " | "</font>) & IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),2,2</font>) & " | "</font>) & IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),3,2</font>) & " | "</font>) & IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),4,2</font>) & " | "</font>) & IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),5,2</font>) & " | "</font>) & IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),6,2</font>) & " | "</font>) & IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),7,2</font>) & " | "</font>) & IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),8,2</font>) & " | "</font>) & IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),9,2</font>) & " | "</font>) & IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),10,2</font>) & " | "</font>) & IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),11,2</font>) & " | "</font>) & IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),12,2</font>) & " | "</font>) & IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),13,2</font>) & " | "</font>) & IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),14,2</font>) & " | "</font>) & IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),15,2</font>) & " | "</font>) & IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),16,2</font>) & " | "</font>) & IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),17,2</font>) & " | "</font>) & IF(<font color="Red">OR(<font color="Green">$J2=$J1,$J2=""</font>),"",INDEX(<font color="Green">IF(<font color="Purple">$J2=$I2:$J$234,$J2:$K$234,""</font>),18,2</font>) & " | "</font>)," | | ",""</font>)}</td></tr></tbody></table><b>Entered with Ctrl+Shift+Enter.</b> If entered correctly, Excel will surround with curly braces {}.<o:p></o:p>
<b>Note: Do not try and enter the {} manually yourself</b></td></tr></table><br /><o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
https://app.box.com/s/xbvu0rz2aagclqso25k6x4gs6tedswzu<o:p></o:p>
<o:p> </o:p>
………………………………. The End !....Thanks for watching….. <o:p></o:p>
 
Upvote 0

Forum statistics

Threads
1,223,922
Messages
6,175,382
Members
452,639
Latest member
RMH2024

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