Yes, there is a table.
This is the rule causing all the headache:
Additionally, when you gain a level in this class, you can choose one of the sorcerer spells you know and replace it with another spell from the sorcerer spell list, which also must be of a level for which you have spell slots.
In the first table, we simply tabulate all the opportunities to learn a spell normally.
In the second table, we assume that the player is always replacing a spell of their lowest level. While this might not be the case, this assumption allows us to get a meaningful upper bound for their highest levels of spells known.
Table 3: This is the Final Answer to the Primary Question
In this third table, we assume that we are ALWAYS applying replacement and that we are replacing our lowest levels of spells known. This gives us the upper bound for how many spells of the highest levels we can have. If the player has fewer spells of those highest levels, they can have instead the remaining as lower-level spells.
For example, at level 20, it's possible to have five level 9 spells. If instead, the player had four level 9 spells, they could have that vacancy filled with a level 8th or lower spell.
In the case of a 9th level caster, which is relevant to you, we have the following upper limits:
Level 3: 4 known spells
Level 4: 4 known spells
Level 5: 2 known spells
Since this is an upper bound, you should read this like so instead:
4 spells of Level 3 or lower
4 spells of Level 4 or lower
2 spells of Level 5 or lower
I hope this helps.
How to construct this table for other archetypes/classes
Table 1: Spells Learned Normally
For this table, we populate every row with a count of how many spells of each spell level a character learns at the current character level. We assume that characters always pick the spell of the highest possible spell level. While they can always pick a spell of lower level, we can account for it later.
In the case of Bards, we should see 4 Level 1 spells, and 0 of every other spell level for Character Level 1. In the case above, Sorcerers have 2 at level 1.
Also, any spells gained through features like the Divine Soul Sorcerer should be included at the level they are gained.
Calculate the totals at the bottom to make some of the next steps more easily.
Table 2: Highest-Possible Replacements at each Level
This table is going to have, for each Character Level, their highest possible substitution. A negative value in a cell means that at the current character level, that many spells of that Spell Level were replaced. A positive value in a cell means that at the current character level, that many spells of that Spell Level were acquired through replacement.
Currently, only Arcane Tricksters, Artificers, Bards, Eldritch Knights, Rangers, Sorcerers, and Warlocks are the only classes that have a replacement clause for a Spell Known feature, and all of them only replace one spell at a time. Therefore, you should only have a single -1 and a single 1 per row.
The positive 1 will always be in the column of the highest possible Spell Level knowable, if it's anywhere at all. We're assuming we always replace maximally. On a level where we can't do a replacement, there won't be one in the column.
The negative 1 (-1) will depend on the totals for that column in Table 1 (how many times we normally learned a spell of this level) and how many past opportunities were used to acquire a spell of this level through replacement (how many times we learned a spell of this level through replacement).
At the current character level, go left to right.
- If we followed the replacements for all the levels before this, would we still know a spell of this level?
- If so, -1.
- If not, blank or 0.
For classes like Arcane Trickster, there may be rows which are blank because there's no way to replace a Spell Known and end up with a higher level spell known. For Arcane Trickster, this happens at Level 11. This is fine. This just means that by this point, the character has had the opportunity to replace all their lower level spells with spells of the highest level so there's nothing to do.
To know that you are doing it right, try it on Arcane Trickster and you should notice a vertical bar of four -1s in the Spell Level 1 column and a vertical bar of eight -1s in the Spell Level 2 column with a gap of two character levels between them at Character Level 11 and 12.
Table 3: Upper Bounds for Spells Known Counts
We use the two previous tables together to create this third table. This table has the Upper Bounds for how many spells of each level the character can know.
We get the values of each cell by summing vertically both tables up to the Level-th row. If you're not sure on how to do this, do it step-by-step:
- At the current player level
- At the current Spell Level
- Add up each number in that column, but before that row, in Table 1.
- Do the same for Table 2.
- Add those numbers together.
- Do that for every Player Level and Spell Level, skipping obviously blank table cells.
For Excel users, you can use the following formula
=SUM(A$1:A1)+SUM(X$1:X1) for the top-left cell of Table 3 where
A1 is the top-left data cell of Table 1 and
X1 is the top-left data cell of Table 2. Then, use the auto-fill drag to spread that formula to all other cells and the relative formula will do it for you.
Interpreting Table 3
Again, as with the Sorcerer, the values on the row corresponding to character level tell you how many spells of each level or lower the character can have. The reason we need to qualify or lower is because any time you can pick a high-level spell, you can pick a lower one to learn instead. But these numbers act as an upper limit to how many spells of the highest levels a character can have.
Here is the Table 3 for Arcane Trickster made using this method.
We would therefore say that for a 13th-Level Arcane Trickster, they know
7 spells of Level 2 or lower
2 spells of Level 3 or lower
This means that three Level 1s, three Level 2s, and three Level 3s is not a valid breakdown of spells known levels for that level whereas four Level 1s, three Level 2s, and two Level 3s is.