A little addendum to my last post: [How-To] create UE3/UDK Texture Atlases (tileable)
Here's a material function which will work with varying setups, no matter what atlas size, border width or amount of sub-textures. The only restriction is a square atlas (e.g. 1024x1024, 2048x2048, 4096x4096).
Should show up in the material function library once the package is loaded. I just copied mine over to one of the Engine Material Function packages for easy accessibility.