Actually if you are doing this using a roll fed printer that is 24" wide then you would need the following equation, where it is important to use the longest image dimension as the length. This should paste straight into excel if you name cells Length, Width, Paper (which needs to contain the price per inch of the paper roll), Ink (ink cost per square inch), size (the maximum width the printer can print to), and feed, the length of paper that you need to waste to get the thing to feed though the printer.
=if(length>size, (paper*length)+(paper*feed)+(length*width*ink), (paper*width)+(paper*feed)+(length*width*ink))
This equation checks to see if the longest dimension of the image will fit in the width of the paper, and if it will it bases the paper length used on the shorter dimension of the image. This calculates the paper cost for the length of roll used, rather than simply an area of paper to match the print, as Redcrown has done. After all if you don't fill the width of the paper, you still have to use it to make the print. The ink cost is fine based simply on the area covered. When it comes to ink/unit area costs I would be inclined to want to know the cost based on laying down the maximum amount of ink over the whole print area. Which would probably be based on a very dark colour that wasn't quite black. That way your average ink costs should not be higher than you expect. IIRC the "standard" methods of costing ink, as used by the printer manufacturers, is based on printing documents, and assumes a quite low total coverage on a "sheet" of paper, I think under 50% total coverage. So be sure the ink cost figures you use are at least based on printing only photographic images.
This only works for single images. If you were printing a number of different images at varying sizes you could possibly save paper costs by juggling around the prints on the paper, for example on a 24" roll it would be possible to print two 9" high panoramas next to each other lengthways and save money. But that would require a lot of complex calculation.
Alan