The ONS has come under fire in recent months over the reliability of some of its statistics, particularly its jobs market figures.
Its statistics are used in deciding government policy, which affects millions, and are also used by the Bank of England to make key financial decisions, such as setting interest rates.
The ONS said that while sales volumes in July rose, sales in the three months to July were down 0.6% when compared with the previous three months.
“Supermarkets, sports shops and household goods stores had a strong start to the year, but spending there has fallen since March,” said the ONS’s director general of economic statistics, James Benford.
However, he added this was partially offset by strong sales online and at clothing and footwear stores.
Mr Benford apologised for errors in past data, and said the ONS had “improvement plans” in place.
The ONS said problems with the retail sales figures meant seasonal adjustments had not been made properly. Its latest release revises most of the retail sales data for the past year.
“The new figures published today show a similar overall pattern of three-month on three-month growth, but with less volatile month-on-month changes,” Mr Benford said.