This command will tell you if your target is within the cell with the specified ID. If your target is within the cell, 1 (true) will be printed to console, otherwise 0 (false) will be printed to console. Use 'player.GetInCell' to see if your character is in a cell. Use 'PickRefById [reference ID]' to select a target that's out of view.
getincell [location id]
|Location ID||The ID of the location cell to check if your target is within.|
Bear's cave mill has a location ID of 00018c8e. This command would return 1 if your target is within the Bear's cave mill cell, 0 if your target is not.
Solitude Blacksmith has a location ID of 0009d5a3. This console command will return 1 if your character is within the cell, 0 if your character isn't.