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?

The formula for volume depends on the shape of the object. For regularly shaped objects, you can use the formula for volume that corresponds to the shape. For example, for a cuboid, the formula is V = l x w x h, where l is the length, w is the width, and h is the height. For a cylinder, the formula is V = πr^2h, where r is the radius and h is the height. For a sphere, the formula is V = (4/3)πr^3, where r is the radius.

If the object has an irregular shape, you can find its volume by using displacement. Fill a graduated cylinder with water, note the initial volume, and then immerse the object in the water. The change in volume is equal to the volume of the object.