I'm not quite sure why COLUMN() doesn't work but perhaps try using COLUMNS function like this
=SUMIF(f,"x",OFFSET(f,0,COLUMNS($E37:E37)))/SUMPRODUCT(N(f="x"),N(OFFSET(f,0,COLUMNS($E37:E37))>0))
in E37 copied across
It's more robust too because it still gives the correct result if columns are added or deleted
Bookmarks