Go back to BobH's post, and follow its instructions. He has it spot on.

[I was about to write pseudocode for the process, but nobody but me would understand it . . . ]

. Charles