applgrid formula