Hello,

I'm currently in the process of trying to neatly sort a rather large & inconsistent column of text.

Example:

Crumbly Cookies
Oatmeal (coarse)
Time: 1hr
3minutes
Cost: 4$
Weight: 6lbs
These cookies are quite
yummy. Eat many!
Croissant
Pastry Flour
Time: 3hrs
Cost: 2$
Weight: 8kgs
At least you will not be
eating the dough.
That the products are made of so far is consistent and absolute. (Flour, pastry flour, oatmeal, wholewheat, etc) And that part of the sorting I've managed by using this:

{=IF(OR(EXACT($A3,listIngredients)),$A2,IF(AND(OR(EXACT(MID($A3,1,FIND(" ",$A3)-1),listIngredients))),$A2,""))}
'listIngredients' is an array

The above code works for identifying the main ingredient, and I'm hoping to work backwards from this point to properly capture and sort the rest of the associated data.

When it comes to time, cost, weight and description, the formatting is too hard for me to pin down.

So far all I've been able to pull together is a bit of code that will return the relative row in which the next instance of 'Time:' 'Cost:' or 'Weight:' appears using this:

{=MATCH(H$1,MID($A2:$A26,1,FIND(":",$A2:$A26)}
$H1 is a column with 'Time:' written in it, so the code will look for 'Time:' in each cell. If I copy and paste it into the next cell over, it will be looking up 'Cost:'. So on and so forth. Unfortunately though that works nicely for returning the relative row, using it in combination with 'indirect' certainly doesn't seem to work.

Any ideas on how I could / should go about this if I havn't already confused the bejeezus out of you?

Thank you very much,


Aaron =]