Yucky, your formula for the surface area of a rectangular prism is missing a variable. The term 2lw is ok, as it has units of area, but the term 2(l+w) has units of length. It should be of the form 2d(l+w), where d is the depth, or SA=2(lw+ld+wd).
As for the triangular prism, it would be helpful to know what variables you can measure. Talon's formula is fine, if you have all those values, but the formula becomes nastier if only allowed, say three variables for a scalene prism.