It would be best if you uploaded a sample workbook with some data. It's not clear what you mean by " & B (a value corresponding to time)". If possible, manually show the expected result you need