Using Dimensional analysis, how do you set up a problem to find the density when given mass and volume?

Suppose the mass of an object is 40 grams and the volume is 20 mL.
Density has units of grams/mL.
Then density = 40 g/20 mL = 2 g/mL. If this isn't exactly what you were looking for, please repost and be a little more specific.

what is the formula for volume?