update mergeCells arithmetic