The formula does not change — only the base-area calculation does. For a rectangular prism, base area = length × width. For a triangular prism, base area = ½ × base × height of the triangle. Once you have that one number, multiply it by the prism's height (or length, for a prism lying on its side) the same way every time.