|In your original message, my warning:|
The only caveat is you can have only ONE occurrence of the target letters,
Only one row at a time, else your answer will be incorrect.
Was given under the impression you only wanted to SHOW the totals,
the formula will actually do what you want by totaling the rows.
If you want them split apart, so Q totals by itself and R totals by itself then