How to exclude anything that follows the last hyphen that starts with Text (A-Z)

SublimizeD

New Member
Joined
Jul 27, 2018
Messages
4
Hey all! I'm new here. I'm having some trouble with my formula. Im trying to get rid of everything after the last hyphen in the respective cells. here is what i have so far.

=IF(LEN([@[column1]])<=10|[@[column2]]|IF(RIGHT([@[column1]]|1)="-"|LEFT([@[column1]]|LEN(SUBSTITUTE([@[Andrew''s Column]]|TRIM(LEFT(RIGHT(SUBSTITUTE([@[Andrew''s Column]]|"-"|REPT(" "|100))|100)|100))|""))-1)|LEFT([@[column1]]|LEN(SUBSTITUTE([@[Andrew''s Column]]|TRIM(LEFT(RIGHT(SUBSTITUTE([@[column2]]|"-"|REPT(" "|100))|100)|100))|""))-2)))

column1 is =SUBSTITUTE([@[Andrew''s Column]]|TRIM(LEFT(RIGHT(SUBSTITUTE([@[Andrew''s Column]]|"-"|REPT(" "|100))|100)|100))|"")

column2 is the original

=IF(ISNUMBER(VALUE(RIGHT([@[Primary Facility]]|1)))|LEFT([@[Primary Facility]]|FIND("-"|[@[Primary Facility]]|1)-1)|[@[Primary Facility]])

Im attempting to exempt the cells with a-z that follow the hyphen. Any help would be appreciated.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

SublimizeD

New Member
Joined
Jul 27, 2018
Messages
4
Hey all! I'm new here. I'm having some trouble with my formula. Im trying to get rid of everything after the last hyphen in the respective cells. here is what i have so far.

=IF(LEN([@[column1]])<=10|[@[column2]]|IF(RIGHT([@[column1]]|1)="-"|LEFT([@[column1]]|LEN(SUBSTITUTE([@[Andrew''s Column]]|TRIM(LEFT(RIGHT(SUBSTITUTE([@[Andrew''s Column]]|"-"|REPT(" "|100))|100)|100))|""))-1)|LEFT([@[column1]]|LEN(SUBSTITUTE([@[Andrew''s Column]]|TRIM(LEFT(RIGHT(SUBSTITUTE([@[column2]]|"-"|REPT(" "|100))|100)|100))|""))-2)))

column1 is =SUBSTITUTE([@[column2]]|TRIM(LEFT(RIGHT(SUBSTITUTE([@[column2]]|"-"|REPT(" "|100))|100)|100))|"")

column2 is the original

=IF(ISNUMBER(VALUE(RIGHT([@[original]))|LEFT([@original]]|FIND("-"|[@[original]]|1)-1)|[@[original]])

Im attempting to exempt the cells with a-z that follow the hyphen. Any help would be appreciated.
 

Forum statistics

Threads
1,141,417
Messages
5,706,311
Members
421,441
Latest member
VapesRub

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
Top