Consider an ionic compound, MX2, composed of generic metal M and generic halogen X.

The enthalphy of formation of MX2= -891.
The enthalphy of sublimation of M= 141.
The first and second ionization energies of M are 605 and 1392.
The electron affinity of X= -339.
The bond energy of X2= 177.

I used the Born-Haber cycle and came up with:
-Lattice energy of MX2=-891-(141+88.5+605-678) to come up with the answer that the -lattice energy of MX2 is -1047.5 but i'm getting marked wrong. Where did I go wrong?????

I just took a brief look; where is the 1392 for second ionization potential? I don't see that in your calculation.

Where would I add that in to my calculation? Like would it look like this:

-Lattice energy of MX2=-891-(141+88.5+605+1392-678)

Yes, that should do it.

Also, I wonder about taking 1/2 x 177. If you do Cl2 bond dissociation for say NaCl, then you take 1/2 Bond energy because you're using only 1/2 of it to make Cl^-. But in this case you're using both parts of the X2 bond energy to make 2X^-. You multiplied 2 x electron affinity (and that is proper).

where is the -678 coming from?

-678 is electron affinity * 2

Shouldn't it be +678 because the formula is E= deltaHf-(H sub + IE + HBE/2)- HEA?

To determine the lattice energy of MX2 using the Born-Haber cycle, you need to consider all the steps involved in the formation of the compound. Let's go through the calculations step-by-step to identify where the mistake might have occurred.

Step 1: Formation of gaseous metal cations (M(g) → M+(g) + e^-)
The enthalpy change for this process is the first ionization energy (IE1) of M, which is 605 kJ/mol.

Step 2: Formation of gaseous metal cations (M+(g) → M2+(g) + e^-)
The enthalpy change for this process is the second ionization energy (IE2) of M, which is 1392 kJ/mol.

Step 3: Formation of gaseous halide anions (X2(g) → 2X^-(g))
The enthalpy change for this process is the negative of the electron affinity (EA) of X, which is -(-339) = 339 kJ/mol.

Step 4: Formation of MX2 solid from gaseous metal cations and halide anions
This step involves the lattice energy (LE) of the compound, which needs to be calculated. The lattice energy can be determined by the formula:
LE = Enthalpy of formation of MX2 - (Sum of enthalpies of formation of component elements)

Given the enthalpy of formation of MX2 is -891 kJ/mol, and the sum of enthalpies of formation of component elements is 141 kJ/mol + 605 kJ/mol + 339 kJ/mol = 1085 kJ/mol, we can calculate the lattice energy:
LE = -891 kJ/mol - 1085 kJ/mol = -1976 kJ/mol

It seems like the mistake occurred in calculating the sum of enthalpies of formation of component elements. You correctly subtracted the sublimation energy of M (141 kJ/mol) and the bond energy of X2 (177 kJ/mol), but it seems there is an incorrect value of 88.5 kJ/mol being subtracted. This value should be revised based on the actual correct enthalpy value for some specific step.

Recheck the values you used for the components and ensure that all the data entered into the calculations are accurate.