Depending on the type of materials and hardware that you buy, it can be cheaper to build your own shelf. Prefab shelving tends to be more expensive because more processing and manufacturing goes into it.