As the previous poster mentioned, it often depends on the flight and the airline. I had a 22" that I fit into their tester and it just fit, then I saw a young girl with a bag that had to be several inches too large. I asked her how she could use it as a carry-on and not get questioned; she said she never had a problem.
Of course, I'm a 58 yr old beer-bellied guy; she was an attractive young woman. I suppose that might have something to do with it!