I want to write a formula, A nested IIF statement (I know you can do it in access but I am working in Excel )

And I need it to say something this:
=IIF((Sheet1!B2=Sheet2!B2),0,(Sheet2!B2-Sheet1!B2))

Basically I want it to say IF B2 in Sheet1 = B2 in Sheet2 display 0
Else Display Value of
B2 in Sheet1 - B2 in Sheet2

Maybe I have the formula written incorrect, the error it 1st gave me was circular reference, and now it is just displaying #Name?