Okay, well I've used column O as the helper and it wasn't as difficult as I first thought (see attached file). It is important to put zero in cell O3 and then you can put this formula in O4:
which can be copied down to the bottom of your data (I've shown it in blue). Then insert a new sheet (Sheet1) and put the headings on rows 1 and 2 with this formula in A3:
this returns the first material number, and you can copy the formula into B3 to get the Material Description. It relies on the data being sorted by material number. Then put this formula in C3:
and copy that across to K3. Then you can copy the formulae from A3:K3 down as far as you need to (until you get hyphens in columns A and B - I've copied to row 14 in the example). This will give you a unique list of materials with the breakdown as requested.
There is something strange about the data in your posted file, though. If you highlight the cells F4:N22 on Sheet2, then press F5 (GoTo), then click on Special and on Blanks, then you can see that not all of the empty cells are selected. This suggests that they are not empty (and this was throwing out my formula for the first material), but if you enter =LEN(F4) in a blank cell you get 0, and =CODE(F4) returns #VALUE, both of which indicate that they are empty. Furthermore, if you select one of the cells and click on the formula bar as if to edit it (or press F2) then press <Enter> without doing anything, then the cell does appear to be blank if you repeat the F5 exercise. I don't know what's happening here, but I had to delete those cells in order to get the final formula to work (as it looks for the last non-empty cell in the range).
Anyway, it seems to be working, so you'll need to try it out on your real data.
Hope this helps.
Pete
Bookmarks