I am not sure I fully understood your question, so please correct me if necessary.
The real density of a compound can differ significantly from that one estimated as weighted average of the densities of its components (what you are doing). Therefore, it would be best to obtain the density of the compound from somewhere else, ideally experimental measurements. If you do not manage to find its value, you may want to proceed as you explained above, but knowing that it may be a very rough estimation.