Hi,
I'd use a resistive voltage divider.
You say "transient" so I assume high frequency.
So don't use very high ohmic resistors.
There are many ways to calculate the resistors. I'd rather go to lower resistance. And I decide to dissipate less than 100mW.
With 24V this means about 6k Ohms mimimum. To the voltage you need some headroom. Maybe a 10k:1k resistive divider is OK.
This give a current of about 2mA at 20V, and a voltage range of 55V max. (11 × 5V).
Higher ohmic resistors have lower current, and thus lower power dissipation. But also lower frequency bandwidth.
Klaus