Shell variable in awk

I have 3 files and each contain m*n matrix.
m = number of rows (horizontal lines)
n = number of columns (entries in a particular line)

What I wish to find is the sum of the 2nd number in the last row.
Ex

file1.dat

2 5 8 8
4 6 7 8
3 8 3 7

file2.dat
3 4 1 4
8 4 0 3
4 7 3 7

file3.dat
9 6 3 5
8 4 8 4
7 5 6 8

The desired result is 8+7+5 ie., 20

What I tried is;

i=1
sum1=0
while [ $i -lt 4 ]
do
tail -1 file$i.dat | awk '{print $2+"$sum1"}'
let i=$i+1
done
echo $sum1

But this is not working.
Please help....
Thanks in advance
__________________

Try this:

tail -1 file$i.dat | awk '{print $2+"'${sum1}'"}'

Hi felipe
Thank you very much. It solved my problem partially. What I was looking for is

sum1=0
do while i < 4
sum1 = sum1 + last_row_second_column_element_of_file(i)
i=i+1
end do
print sum1

Initially I have to pass a variable into awk and then retrieve it back to shell....

Thanks in advance for the help.

This code:

i=1
sumValue=0
while [ ${i} -lt 4 ]
do
	value=`tail -1 file$i.dat | awk '{print $2}'`
	sumValue=`expr ${sumValue} + ${value}`
	i=`expr ${i} + 1`
done
echo ${sumValue}