Question: I am getting a syntax error on this statement below that combines an If, IsError and VLOOKUP statement - I been trying everything..... anyone know why?

```
If Application.Worksheetfunction.IsError(VLOOKUP(cell.Value,'[Codes.xlsx]Processing Codes'!ProcessingCodesTable,5,FALSE)) = FALSE then

```

Thanks any help would be greatly appreciated!

Answer: 
A SQL table represents an *unordered* set. There is no concept of "in-between" (or first or last or previous or next). The rows simply are; they are in the table.

Queries return *result sets* that have an order. And, you can control the order when you write the query. That is why you use the `order by` clause. When you write:

```
select *
from mytable;

```

The results are in any order that the database wants to return them. There are simply no guarantees. Instead, query the database as:

```
select *
from mytable
order by col1;

```

And you will get the data properly ordered.

The moral of the story: just insert the data into the table. When you query it, use an `order by` clause to get the results in your desired order.
Hmmmm.

It doesn't seem you are using rows and columns as they are intended in a database.

However, a solution for your problem would be doing this:

For every Math, start on a new row:

```
ID  Stuff
100 Maths Science Biology
200 Maths Science Biology Geography
300 Maths Science 

```

To read this data structure you would start with the first index and add 1 for each entry in the string.

For example, when "expanded", 

```
100 Maths Science Biology

```

would become

```
Maths = ID + 1
Science = ID + 2
Biology = ID + 3 

```

...

Now, adding a new `Stuff`:

When a new stuff is added, find the place where it should go between and insert it there, then when you "expand" the strings again, the newly inserted one will be in order.

```
100 Maths Physics Science Biology

```

would become

```
Maths = ID + 1    = 101
Physics = ID + 2  = 102
Science = ID + 3  = 103
Biology = ID + 4  = 104

```

...