Excel with tracking numbers - tie to specific URL

Column AD has tracking numbers - some cells are blank (i.e. AD from AD10:AD100)
AD can have four different conditions: 8, 12, 14 digit numbers or combination that starts with a letter

If AD = 8 digit then AR = 3w.deliveryservice1.com
If AD = (Letter)xxxx then AR = 3w.deliveryservice2.com
If AD = 12 digit (starts with a six) then AR = Hyperlink(concatenate(AS & AD & AT))
Id AD = 14 digit (starts with a five) then AR = Hyperlink(concatenate(AU & AS & AD & AT))  'AU = zero (0)

AS = first part of delivery service URL
AT = last part of delivery service URL

Thanks in advance for any assistance
dgd1212Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tj aCommented:
Try this formula and let me know how it goes.

=IF(LEN(AD1)=8,"3w.deliveryservice1.com",IF(LEN(AD1)=12, HYPERLINK( CONCATENATE(AS1,AD1,AT1)),IF(LEN(AD1)=14, HYPERLINK(CONCATENATE("0",AS1,AD1,AT1)),"3w.deliveryservice2.com")))

And drag it down

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rodney EndrigaData AnalystCommented:
=IF(LEN(AD1)=8,"3w.deliveryservice1.com",IF(LEFT(AD1,1)="5",HYPERLINK(CONCATENATE(AU1,AS1,AD1,AT1)),IF(LEFT(AD1,1)="6",HYPERLINK(CONCATENATE(AS1,AD1,AT1)),"3w.deliveryservice2.com")))]

Open in new window


Copy down to remaining rows.
dgd1212Author Commented:
Thank You!! works as expected.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.