Why not just keep the formula in Excel and get the value in your code?

Why do you want to convert it to VBA? VBA will be slower