Multiple formulas in one cell

spencerb

New Member
Joined
Sep 23, 2015
Messages
7
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I have multiple formulas that I need to run in one cell. I need to run them in the following order -

In cell C2 -
The 1st formula is: =SUBSTITUTE(H2,", United States","")
The 2nd formula is: =LEFT(H2,FIND(CHAR(1),SUBSTITUTE(H2,",",CHAR(1),LEN(H2)-LEN(SUBSTITUTE(H2,",",""))))-1)

I can't seem to find a way to run both formulas in the same cell. They have to be run in that order or the result will not be correct sometimes. I am trying to remove ", United States" so the second formula will work correctly and remove the city, state, and zip.

1640574935629.png


The final result should look like this:

1640575042109.png


I can accomplish this with the two formulas in seperate columns, but it would be much cleaner if it was all in one column.

Thank you,
Spencer
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,214,911
Messages
6,122,195
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top