OK, Here is the formula I've worked for the third enemy slot, but there is a mistake with it, and I'm too tired to try to work it out:

=IF(NOT($J48=0),$J48,IF(OR($D49=$N50,$D49=$N49),IF(NOT($G49=0),IF(OR($G49=$N50,$G49=$N49),

IF(NOT($J49=0),$J49,IF(OR($D50=$N50,$D50=$N49),IF(NOT($G50=0),IF(OR($G50=$N50,$G50=$N49),

IF(NOT($J50=0),$J50,IF(OR($D51=$N50,$D51=$N49),IF(NOT($G51=0),IF(OR($G51=$N50,$G51=$N49),

IF(NOT($J51=0),$J51,$D$1052),$G51),$D$1052),$D51)),$G50),IF(OR($D51=$N50,$D51=$N49),

IF(NOT($G51=0),IF(OR($G51=$N50,$G51=$N49),IF(NOT($J51=0),$J51,$D$1052),$G51),$D$1052),$D51)),$D50)),$G49),

IF(OR($D50=$N50,$D50=$N49),IF(NOT($G50=0),IF(OR($G50=$N50,$G50=$N49),IF(NOT($J50=0),$J50,

IF(OR($D51=$N50,$D51=$N49),IF(NOT($G51=0),IF(OR($G51=$N50,$G51=$N49),

IF(NOT($J51=0),$J51,$D$1052),$G51),$D$1052),$D51)),$G50),IF(OR($D51=$N50,$D51=$N49),

IF(NOT($G51=0),IF(OR($G51=$N50,$G51=$N49),IF(NOT($J51=0),$J51,$D$1052),$G51),$D$1052),$D51)),$D50)),$D49))

`M51`

1

=IF(NOT($J48=0),$J48,IF

2

(OR($D49=$N50,$D49=$N49),IF

3

(NOT($G49=0),IF

3A

(OR($G49=$N50,$G49=$N49),IF

3B

(NOT($J49=0),$J49,IF

3C

(OR($D50=$N50,$D50=$N49),IF

3D

(NOT($G50=0),IF

3D1

(OR($G50=$N50,$G50=$N49),IF

3D2

(NOT($J50=0),$J50,IF

3D3

(OR($D51=$N50,$G50=$N49),IF

3D4

(NOT($G51=0),IF

3D4A

(OR($G51=$N50,$G51=$N49),IF

3D4B

(NOT($J51=0),$J51,$D$1052)

/3D4B, 3D4A

,$G51)

/3D4A. 3D4

,$D$1052)

/3D4, 3D3

,$D51)

/3D3, 3D2

)

/3D2, 3D1

,$G50)

/3D1, 3D

,IF

3E

(OR($D51=$N50,$D51=$N49),IF

3F

(NOT($G51=0),IF

3F1

(OR($G51=$N50,$G51=$N49),IF

3F2

(NOT($J51=0),$J51,$D$1052)

/3F2, 3F1

,$G51)

/3F1, 3F

,$D$1052)

/3F, 3E

,$D51)

/3E, 3D

)

/3D, 3C

,$D50)

/3C, 3B

)

/3B, 3A

,$G49)

/3A, 3

,IF

4

(OR($D50=$N50,$D50=$N49),IF

5

(NOT($G50=0),IF

5A

(OR($G50=$N50,$G50=$N49),IF

5B

(NOT($J50=0),$J50,IF

5C

(OR($D51=$N50,$D51=$N49),IF

5D

(NOT($G51=0),IF

5D1

(OR($G51=$N50,$G51=$N49),IF

5D2

(NOT($J51=0),$J51,$D$1052)

/5D2, 5D1

,$G51)

/5D1, 5D

,$D$1052)

/5D, 5C

,$D51)

/5C, 5B

)

/5B, 5A

,$G50)

/5A, 5

,IF

6

(OR($D51=$N50,$D51=$N49),IF

7

(NOT($G51=0),IF

7A

(OR($G51=$N50,$G51=$N49),IF

7B

(NOT($J51=0),$J51,$D$1052)

/7B, 7A

,$G51)

/7A, 7

,$D$1052)

/7, 6

,$D51)

/6, 5

)

/5, 4

,$D50)

/4, 3

)

/3, 2

,$D49)

/2, 1

)

EDIT I'd made 1 mistake in the first formula, and 3 in the second. Both are fixed and are working fine now!!

Also, I don;t think I made it clear enough the purpose of these formulas. As I fill in the enemies names in the D G & J columns, I want the three enemies that are used within the scene to *automatically* be filled out in column N, without having to type the enemies names in manually. These formulas sweep each cell of names used within the four formations (columns D G & J) and fills out the 3 enemy slots in column N automatically