So when you turn a vehicles key to the on position the CEL is supposed to come on and then turn off after a few seconds correct?

Well the CEL comes on and SOMETIMES goes off...when this happens the car starts no problem...

The other 90% of the time the CEL comes on and stays on...when this happens the car will not start

ideas?