An indole based “ratiometric” and “turn-off” tris(N-methylindolyl)methane based chemosensor depicting a contrasting fluorescent behavior towards Hg2+ and Cu2+ ions, exhibited NOR and YES logic functions, and also imaged intracellular Hg2+ in cervix cancer (HeLa) cells.