Can't find Excel VBA formula type mismatch error
===

I am getting type mismatch 13 error and I can't see where it is.

Here is the code.

    Set concRange = Range(Cells(11, 48), Cells((10 + noDilutions), 48))
    Set deadRange = Range(Cells(11, 49), Cells((10 + noDilutions), 49))
    analysisSheet.Cells(f, 14).Value = (WorksheetFunction.Lookup(WorksheetFunction.Index(deadRange, WorksheetFunction.CountIf(deadRange, " >= " & (WorksheetFunction.Max(deadRange) / 2))), deadRange, concRange)) - (((WorksheetFunction.Index(deadRange, WorksheetFunction.CountIf(deadRange, " >= " & (WorksheetFunction.Max(deadRange) / 2)))) - (WorksheetFunction.Max(deadRange) / 2)) * ((WorksheetFunction.Lookup(WorksheetFunction.Index(deadRange, WorksheetFunction.CountIf(deadRange, " >= " & (WorksheetFunction.Max(deadRange) / 2))), deadRange, concRange)) - (WorksheetFunction.Lookup(WorksheetFunction.Index(deadRange, WorksheetFunction.CountIf(deadRange, " <= " & (WorksheetFunction.Max(deadRange) / 2))), deadRange, concRange))) / ((WorksheetFunction.Index(deadRange, WorksheetFunction.CountIf(deadRange, " >= " & (WorksheetFunction.Max(deadRange) / 2)))) - (WorksheetFunction.Index(deadRange, WorksheetFunction.CountIf(deadRange, " <= " & (WorksheetFunction.Max(deadRange) / 2))))))

I've tried changing "WorksheetFunction" to "Application" and "Application.WorksheetFunction".

Yes it is a very very long formula :D

Can anyone help me out?

Thank you very much.