I had a cold with thick yellow phlegm and now the cough is non-productive but not going away - 3 weeks. How long before cough goes away?

3 wks not long 4 col. You can't rush Mother Nature! That your cough now is non-productive is good progress and demonstrates that you're on your way to a cure. Your body takes time to heal. Patience, patience.