Dry port, sherry and Marsala all make good substitutes for Madeira wine in a dish. These substitutions also work well for someone looking for a similar wine to pair with a meal. Although the flavor profiles are a little different, these substitutions all work because they are also fortified wines.
Fortified wines are wines that have distilled spirits, such as brandy, added to them. Sweetness varies dramatically within each style of fortified wine; be mindful of whether a recipe calls for a sweet or dry style of Madeira, and substitute accordingly. To avoid cooking with alcohol or have a limited selection of ingredients, try substituting beef or chicken broth for savory dishes and fruit juice for sweet ones.