For every MC run (single sample), you will have an offset. Now, in every MC run (again, single sample) you run all DAC settings, i.e., run your DC sweep for every DAC code. You will end up with 32 offsets for every MC sample (500 in your case). While processing the data, from the 32 offsets of every sample, you get the offset that is closest to the untrimmed mean. Ideally, if your trim is designed correctly, the trimmed offset will be around +/-1LSB of your offset DAC.