Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

Append to contents of B2 with a dash (-), plus the contents from D2, and add the word "Branch" to the end.

Exclude integer at the beginning of an address.

Exclude every single character reference.

Example: If the company name in B2 is "ADVANCE STORES COMPANY, INCORPORATED" and the address in D2 is "610 N Loop 340", then the result would be "ADVANCE STORES COMPANY, INCORPORATED - Loop 340 Branch"

sample-for-ee.csv

Exclude integer at the beginning of an address.

Exclude every single character reference.

Example: If the company name in B2 is "ADVANCE STORES COMPANY, INCORPORATED" and the address in D2 is "610 N Loop 340", then the result would be "ADVANCE STORES COMPANY, INCORPORATED - Loop 340 Branch"

sample-for-ee.csv

Experts Exchange Solution brought to you by

Enjoy your complimentary solution view.

Get this solution by purchasing an Individual license!
Start your 7-day free trial.

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.

In E2

```
=B2&" - "&IF(FIND(" ",REPLACE(D2,1,FIND(" ",D2),""))=2,REPLACE(REPLACE(D2,1,FIND(" ",D2),""),1,2,""),REPLACE(D2,1,FIND(" ",D2),""))&" Branch"
```

```
=B2&" - "&IF(FIND(" ",REPLACE(D2,1,FIND(" ",D2),""))=2,IFERROR(REPLACE(REPLACE(REPLACE(D2,1,FIND(" ",D2),""),1,2,""),FIND("Ste ",REPLACE(REPLACE(D2,1,FIND(" ",D2),""),1,2,"")),255,""),REPLACE(REPLACE(D2,1,FIND(" ",D2),""),1,2,"")),IFERROR(REPLACE(REPLACE(D2,1,FIND(" ",D2),""),FIND("Ste ",REPLACE(D2,1,FIND(" ",D2),"")),255,""),REPLACE(D2,1,FIND(" ",D2),"")))&" Branch"
```

```
=B2&" - "&IF(FIND(" ",REPLACE(E2,1,FIND(" ",E2),""))=2,IFERROR(REPLACE(REPLACE(REPLACE(E2,1,FIND(" ",E2),""),1,2,""),FIND("Ste ",REPLACE(REPLACE(E2,1,FIND(" ",E2),""),1,2,"")),255,""),REPLACE(REPLACE(E2,1,FIND(" ",E2),""),1,2,"")),IFERROR(REPLACE(REPLACE(E2,1,FIND(" ",E2),""),FIND("Ste ",REPLACE(E2,1,FIND(" ",E2),"")),255,""),REPLACE(E2,1,FIND(" ",E2),"")))&" Branch"
```

I tried this syntax with E2 instead of D2 because I inserted column C for this output. It isn't working.

One of them appears when the cell in the E column is blank, but another one appears when the value in the E cell is 708 Saratoga which makes little sense to me.

I'm using the following syntax:

```
=B2&" - "&IF(FIND(" ",REPLACE(E2,1,FIND(" ",E2),""))=2,IFERROR(REPLACE(REPLACE(REPLACE(E2,1,FIND(" ",E2),""),1,2,""),FIND("Ste ",REPLACE(REPLACE(E2,1,FIND(" ",E2),""),1,2,"")),255,""),REPLACE(REPLACE(E2,1,FIND(" ",E2),""),1,2,"")),IFERROR(REPLACE(REPLACE(E2,1,FIND(" ",E2),""),FIND("Ste ",REPLACE(E2,1,FIND(" ",E2),"")),255,""),REPLACE(E2,1,FIND(" ",E2),"")))&" Branch"
```

EE-value-error.xlsx

In C2

```
=IF(E2="",B2,B2&" - "&IF(IFERROR(FIND(" ",REPLACE(E2,1,FIND(" ",E2),"")),0)=2,IFERROR(REPLACE(REPLACE(REPLACE(E2,1,FIND(" ",E2),""),1,2,""),FIND("Ste ",REPLACE(REPLACE(E2,1,FIND(" ",E2),""),1,2,"")),255,""),REPLACE(REPLACE(E2,1,FIND(" ",E2),""),1,2,"")),IFERROR(REPLACE(REPLACE(E2,1,FIND(" ",E2),""),FIND("Ste ",REPLACE(E2,1,FIND(" ",E2),"")),255,""),REPLACE(E2,1,FIND(" ",E2),"")))&" Branch")
```

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 trialIn C2

```
=IF(E2="",B2,B2&" "&IF(IFERROR(FIND(" ",REPLACE(E2,1,FIND(" ",E2),"")),0)=2,IFERROR(REPLACE(REPLACE(REPLACE(E2,1,FIND(" ",E2),""),1,2,""),FIND("Ste ",REPLACE(REPLACE(E2,1,FIND(" ",E2),""),1,2,"")),255,""),REPLACE(REPLACE(E2,1,FIND(" ",E2),""),1,2,"")),IFERROR(REPLACE(REPLACE(E2,1,FIND(" ",E2),""),FIND("Ste ",REPLACE(E2,1,FIND(" ",E2),"")),255,""),REPLACE(E2,1,FIND(" ",E2),""))))
```

Microsoft Excel

From novice to tech pro — start learning today.

Experts Exchange Solution brought to you by

Enjoy your complimentary solution view.

Get this solution by purchasing an Individual license!
Start your 7-day free trial.

1) Open your workbook

2) Press Alt+F11 to open VB Editor

3) On VB Editor --> Insert --> Module and paste the Function code given below into the opened code window.

4) Close VB Editor and save your workbook as Macro-Enabled Workbook

Now you can use the function CompanyWithAddress on the sheet as below...

In E2

=CompanyWithAddress(B2,D2)

and then copy it down.

Function Code:Open in new window

For details, refer to the attached where I have inserted the formula in col. E, highlighted yellow.

sample-for-ee.xlsm