Q. Is there an easy way to calculate the lengths of my 2x4s?

There sure is!
We designed the Bracket so that you’re always subtracting whole numbers from the size of your shelf (green).”

Rendered_Shelf_with_Dimensions-Masonite