Just like the title states, is it haraam to take medicine that contains alcohol?
No, it's not haraam to take medicine that contains alcohol, but haram to use alcohol itself as a medicine.
That's because when melted with water (or medicine) in small amounts (for example, 5% alcohol), alcohol will dissolve and the result will not cause person to be drunk, which is why alcohol is prohibited (causing one to be drunk), and once the prohibition reason is gone, then prohibition itself is gone, too.
Here is a quotation from one major fiqh book (of the Shafei school):
Also there are fatwas about this issue:
Hope that's clarifying enough.
P.S: sorry for typos and bad translation, any edit is most welcome :)
Short answer is : Doing so knowingly is haram.
Alcohol in general is haram. Based on your question you probably already knew that. Reference is [2:219]
If this is the only medicine that can treat your ailment, with no non-alcoholic medicine available, you probably can use it to treat yourself based on the necessity principle, however do consult a scholar if you can.
You can eat forbidden foods due to necessity. Reference: [2:173]
A translated fatwa from my country (Malaysia, Shafi'i):
(I'm not going to translate the word Arak here, as the english word for alcohol is used for the drink as well as the chemical. In context, the word Arak here means a drink that is used as an intoxicant.)
(Personally disagree with point 2 as other scholars have said that non-alcoholic beer and wine vinegar is halal, but just translating)
Another less formal source on this:
Some research turns up this point of view as a common one in other parts of the world, but this is the most formal version I could find.