Chosen Solution

my gas gauge will not work but for about 10 percent of the time on my 1997 ford ranger

Try this video to help you diagnose the problem: https://www.youtube.com/watch?v=QO9rfPeX

The sender unit may well be the problem but you dont need to pull the bed to replace or repair it . just drop the tank. The sender unit has small connection barbs on it that may get corroded by ethanol based fuels if you clean the connectors this can help.

It is the fuel sending unit you need to pull the bed off and replace it with a new one it will work perfectly then

Cut bed and have trap door for later since old truck