It would appear that according to the research evidence anti-inflammatories are indeed effective for pain relief but have shown no proven benefit in actually reducing the signs of inflammation, such as swelling, in a sprained ankle for example.
So, the answer is yes, but not in the way most of us would expect.
In a recent British Journal of Sports Medicine podcast, the effectiveness, use and safety of these commonly used drugs are discussed. The research would suggest that Paracetamol may be as effective in alleviating pain so this should be tried first as it has a lower risk of side effects.
The best pain relief may be achieved by combining Paracetamol with an anti-inflammatory such as ibuprofen (Neurofen) and often a lower dose of the anti-inflammatories is therefore required, thereby reducing the risk of side effects.