MSPS whose names begin with a letter in the second half of the alphabet have not been able to ask ministers questions at some Holyrood sessions since March due to an embarrassing IT glitch.

The Scottish Parliament's chief executive, Paul Grice, admitted to politicians that the situation was "completely unacceptable" and has apologised for the blunder.

He said a computer system that selects MSPs' questions in a random draw had not picked up those with surnames beginning with the letters N to Z for up to 12 of 27 weeks of parliamentary business. The issue affected general and portfolio questions sessions, when MSPs elicit information from ministers and attempt to hold the Government to account.

The issue may have affected politicians including former First Minister Alex Salmond, Liberal Democrat leader Willie Rennie and Alex Rowley, the Scottish Labour deputy leader.

It is believed that the problem was caused by a faulty software upgrade in March. A "manual workaround" has now been implemented while a solution is found.

In a letter to MSPs, Mr Grice said: "This situation is clearly unacceptable. I wish both to apologise sincerely for the failing... The next step will be to replace the problematic software. The replacement software will include additional audit functionality as a means to provide assurance that all participating names have been picked up by the system before they are randomised and drawn. It is expected that, subject to rigorous and satisfactory testing, the new software will be in place in time for the draw on December 7."