First of all, your calculation of the column and line index is not correct (it gives a wrong result for the last cell in each row). If the grid has 15 columns and the first cell has #1 then it should be:
int columnTarget = (targetCoordinate - 1) % 15;
int lineTarget = (targetCoordinate - 1) / 15;
int columnObject = (objectCoordinate - 1) % 15;
int lineObject = (objectCoordinate - 1) / 15;
Then you can compute the horizontal and vertical difference as
int deltaX = abs(columnObject - columnTarget);
int deltaY = abs(lineObject - lineTarget);
But the final step depends on what kind of distance you want to compute.
float distance = sqrt(pow(deltaX,2)+pow(deltaY,2));
// Or better:
float distance = hypotf(deltaX, deltaY);
gives the "Euclidean distance", i.e. the length of a straight line between the centers of the cells.
If you want to calculate the "shortest path" where horizontal, vertical and diagonal moves are allowed then the distance would be
int distance = MAX(deltaX, deltaY);
If only horizontal and vertical moves are allowed then the length of the shortest path is
int distance = deltaX + deltaY;