If you are simply talking about 2D here then you are pretty much doing the right thing already.

1. Compute which cell the object in question is in
2. Compute world coords for that cell - multiply by cellsize
3. Compute how far into the cell object is
4. Compute world coords for object
5. Add difference of cell world coords and object world coords to object world coords


The flaw in your algo is that it does not take into account the current scroll positions of your map. You want how far into the map your object is...not how far into the screen. All you need to do is add the scroll amounts to what you already have and it will work for all camera positions.

But if camera scrolling is implemented in world coordinates then you must add (scrollx/cellsize) and (scrolly/cellsize) to playercellx and playercelly.