Rolling up a formula field

hey guys, is there any way or workaround for rolling up values in a formula field? When I try i get the following error:

“Error with formula: argument number 1 given to function avg was of type array but the only usable type for this argument is a list of number values obtained from a lookup or link row field reference.”

I have to paste the values to a number field and roll up that field, but I cant roll up the formula field directly

my bad. turns out some rows were empty which was messing up everything