Hello forum

I have the below code which works great until i get a error

=SUMIF(sheet1!L:L,A4,sheet2!I:I)
This works for the error is i am summing on teh same sheet but i cant get the above code to run when it's on anothwer sheet
=SUMIF(G1:G30,"<>#N/A")
thanks in advance for the help