In reply to Oujmik: Okay, here is a daft but effective solution for you.
=TREND(INDIRECT("A1:A"&COUNT(A1:A20)),INDIRECT("B1:B"&COUNT(B1:B20)),2)
The range A1:A20 and B1:B20 should cover the largest number of items you will ever need. If you change the columns or the first row, you will need to change the other bits of the formula.
What this is doing is counting how many items there are in each row then constructing the cell reference dynamically to only reference as far as the last non-blank cell. Only works if all your non-blank cells are at the top.