I built a spreadsheet that accurately determines a character's level by looking at the experience.
You can find a chart of this here: https://www.ign.com/wikis/dungeons-and-dragons/Level_and_XP_progression
The formula I actually use is (for Google Sheets) =INT(0.02*(SQRT((B2+125)*5)-25)+1) ; The int() 's purpose is to round the value down to the nearest integer because there are no non-interger levels in Dungeons & Dragons. And B2 is the current Character's Experience.
Anyway I simplified the formula (ignoring int()) to: =((5*B2+625)^0.5+25)/50
$$\frac{\sqrt{5\times\text{current experience}+625}+25}{50}$$
I was wondering if there is a more eloquent or easy to write the formula than what I have in order to calculate a players level based on a given amount of experience?
Seems unlikely. The level breaks are just the triangular numbers $\times 1000$, i.e., $500 n(n-1)$, and what you’ve got in your question is the result of applying the quadratic formula to this. Any other expression for this value is also likely to involve radicals, too. One thing you could do to make it a bit simpler is to absorb that factor of $1000$ into the XP term: $$\left\lfloor {1+\sqrt{\text{xp}/125+1}\over2}\right\rfloor.$$
Then again, you could instead simply replicate the level progression table in a couple of hidden columns of your spreadsheet and use Excel’s
VLOOKUPfunction.