I've got the formula to get the tracking link if I have the tracking number, however I'm looking for help to get the formula for when I have a reference number instead.
see link I have now:

=IF(ISNUMBER(SEARCH("1z",AH2)),HYPERLINK("http://wwwapps.ups.com/WebTracking/processInputRequest?HTMLVersion=5.0&loc=en_US&Requester=UPSHome&tracknum="&AU2&"&AgreeToTermsAndConditions=yes&ignore=&track.x=25&track.y=16", "UPS Tracking page"),"")

Where AU2 is the actual tracking number

I have a column: M which is potential reference number. I would think simply changing the formula to match the ups reference link was the way to go, however it is not working.

Anyone have an idea if this is possible?