So far agree with just about everyone's advice so far about checking the effective top tube length. You can do more to make a smaller bike larger (seatpost height and/or setback, stem length and/or height) than you can to make a larger bike smaller.
People of the same height can have very different preferences in fit. There was a google spreadsheet where Long Haul Trucker owners entered their height, frame size, and adjustments they made to their bike. People of the same height varied from size preferences of 52 to 58.