@Josh Fernandez Yes. Just have your paperwork set up at closing of the sale and then you will have 45 days to target your 4 plex. You may want to look before you sell. After the 45 days you have 180 to actually close on the targeted property.
@Josh Fernandez , The type of real estate doesn't matter as long as you intend to hold it for investment purposes. So a sale of a SF and 1031 into a MF is fine. Using the sales proceeds in the 1031 as down payments on bigger or more replacements is a very common strategy.
One small correction to @Ryan Blake s great synopsis. You do have to have your qualified intermediary in place prior to the closing of the sale. And you do have 45 days after the sale to simply identify your potential replacement properties. But the entire exchange period is 180 days - the 45 days is inside that 180. So it's 45 to identify and 135 after that to close.