Unless I am missing something, on top of the getA1Notation error your onEdit function never calls NormalSort(). Change it to: function onEdit(e) { if (e.range.getA1Notation() == 'D3') { NormalSort(); } }