Calculate playlist length from songs.
Playlist length is track count times average length, with one wrinkle: crossfade overlaps consecutive tracks, so a playlist with a six-second crossfade is shorter than the sum of its songs by six seconds for every join. Comparing the result against a target — a two-hour drive, a gym session, a party — and converting the gap back into tracks gives an actionable edit rather than an abstract number.
Playlist duration
Total seconds = tracks x average track seconds - (tracks - 1) x crossfade seconds
Gap to target
Tracks to adjust = absolute gap in seconds / average track seconds
Around three and a half minutes, or 210 seconds, for mainstream pop and rock. Electronic, jazz and classical run considerably longer, so check your own library rather than assuming.
Gapless removes silence but does not overlap audio, so it leaves the total essentially unchanged. Only crossfade actually shortens a playlist.