Let's say you think of a number from 1 to 100 and ask someone to guess that number... You thought of 83 but the other person says 84... And then you say "Close, but no cigar".
This expression comes from a Golf tradition... If you're playing golf with your friends and instead of working the ball into the hole with a few drives you make it in a single play... you're friends are supposed to buy you a cigar after the game...
+ My sister?
- Close, but no cigar.
+ Who then?
- Your Mama.