how to calc variance efficiently?

for the data with weights. I am using HP12c. Thanks