@obscurity
Thank you I found it and followed the instructions.
The re-indexing took about 15 minutes in the end and at first glance it looked great.
The flags that had a number against them but no messages, didn't any longer and the ones that did have a flag appeared correctly.
But...only for a few minutes and then the numbers started to increase steadily. It pulled in old messages that may have had flags against them in the past.
So I'm back to status quo. Yellow flag says 1, no messages there. Blue flag says 3, nothing there either.
Red flag, I removed the flags from the old messages and now the count is correct, which it wasn't previously.
Oh by the way after the re-index, it showed up approx. 100 messages in various folders as unread. Very bizarre.
Any other ideas. I didn't reboot after the re-index, so maybe I will try that?
Many thanks