Welcome to the Airtable Community! If you're new here, check out our Getting Started area to get the most out of your community experience.

Extract text between two strings

Topic Labels: Formulas
672 1
Showing results for 
Search instead for 
Did you mean: 

Hi everyone.

I’m trying to extract a string that occurs between the same left string, but the right string has 2 possibilities

The bolded string is what I’d like to extract

  1. VAR. 1 - between > and >
    Industry > Banking & Finance > Trading (1.0)

  2. VAR. 2 - between > and (
    Industry > Banking & Finance (1.0)

Thanks a ton for your help.

1 Reply 1

Welcome to the community, @Subir_Kumedan! :grinning_face_with_big_eyes: Here’s a formula that will do the trick. Replace {FIELD_NAME} with the name of your field:

TRIM(MID(SUBSTITUTE(SUBSTITUTE({FIELD_NAME}, " > ", REPT(" ", 50)), " (", REPT(" ", 50)), 50, 50))

Screen Shot 2020-07-25 at 1.19.30 PM

As long as the piece you want to extract is after the first “>”, this will work. If its position differs based on other conditions, it won’t.