Calculate the molar mass of the compound

3.01x10^23 molecules of compound Z have a mass of 9g

is it
3.01x10^23molescules x 1mol/6.02x10^23 x Z/1mol = 9g
compound Z = 8g

thanks in advance

2 answers

I wouldn't do it that way.
I would think
3.01 x 10^23/6.02 x 10^23 = 0.5 mol.
So if 0.5 mol has a mass of 9 g, 1 mol would have a mass of ?? grams.
thanks for the correction!
now I have to fix all my answers with the same question format :(