I'm given data where address below is in one cell. Col G
Most addresses only have the 5 digit Zip
I need to extract the zip but only the first 5 for those that have Zip+
The formula works great except for these
How can I edit my formula?

123 Road Trl - Courtland VA, 23837-1048
456 Some Road - Chesapeake VA, 23320-1602
=TRIM(RIGHT(SUBSTITUTE(G3," ",REPT(" ",255)),255))*1

The code then compares to a Zip data list for other detail.
Thanks
Jim