Calculating the IRR never ever requires you to know the cost of capital – it is completely independent of the cost of capital.
You make two guesses and the approximate between them – I think it is dreadful to learn a formula because there is no need to. Once you understand it you do not need a formula.
You need to watch the free lectures on investment appraisal for Paper F9 (and if needed Paper F2). The technique is exactly the same for P4 and is revision of F2 and F9.