Excellent, thank you Alan, that did the trick but created another minor prob. the 2nd col in my range (q2 - line items) does need the formula copied because the formula causes it auto loop (i.e. 1,2,3...). with this fix, line item is always 1.