Ok so I am trying to make the following formula in excel talk.

If X is dividable by 5 (whole numbers only) then divide x by 5 and multiply by y. If x is not dividable by 5 then leave as last increase.

An example would be
x=1 z = $0
x= 2 z =$0
x=3 z=$0
x=4 z=$0
x=5 z=$1
x=6 z=$1
x=7 z=$1
x=8 z=$1
x=9 z=$1
x=10 z=$2

So notice how at every increment of 5 z which is my answer cell will go up by $1. I feel this might be a bit complicated but i really need to know how to make this. Thank you for any help.