I am doing it like this:
Do two seperate statsguru queries: one for the player, another for the country during his playing period.
Filter both the queries with "team 2nd innings"and "match lost" checked.
The results page comes up with both the player's country and the opposition 2nd innings totals. In both cases. But we want only the player innings (for the first query) and the country total (for the 2nd query).
Clicking on the R/W column heading sorts out the country and the player's innings only, in corresponding query results.
Then copy those two lists as txt files. Delete the entries of tests from the country list which the player did not play in. Now the player innings list and the country innings list should have the same number of entries.
Open text files in excel. delimit accordingly.
Add up the country totals.
Add up player totals.
Calculate percentage and other stats.