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: 
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

```

...
As others have noted relational databases are not really meant to work with ordered lists.
You could work out some convoluted solution like select the "math" rows followed by "science" rows and then use that to insert "Physics" row.

Something like:

```
CREATE TABLE temp_table AS
(
(SELECT 
t1.id+1 AS id,
'Physics' AS course
FROM 
table t1 JOIN table t2 
ON 
t1.course='Maths' AND t2.course='Science' AND t1.id+1=t2.id)
UNION
SELECT * FROM TABLE)

```

And then work something to update other labels maybe using rank() windowed function.