Home > front end >  How to extract a special word from the beginning of values in excel?
How to extract a special word from the beginning of values in excel?

Time:01-18

There is a column in excel want to extract the word of the from the beginning of values. Just the word of the must extract.

enter image description here

CodePudding user response:

In cell B1 ... =IF(C1=A1,"",LEFT(A1,3))

In cell C1 ... =TRIM(IF(LEFT(UPPER(A1),4) = "THE ",MID(A1,4,1000),A1))

IF

Just move your references as need be.

CodePudding user response:

How about:

IFERROR(MID(A2,FIND(" ",A2,1) 1,LEN(A2)),A2)

IFERROR(LEFT(A2,FIND(" ",A2,1)-1),"")

enter image description here

CodePudding user response:

Here is a solution that you can use :

Cell F1 has the key word you would like to extract out I have given 3 example ( "the" , "is" , "very")

The logic is

  1. Column F I determine if the strings starts with the key word . I use MID and LEN functions. It gives a logical True or false

Picture-01

  1. In Column G I show the word to be extracted if the string matches (i.e. Column F is True else a nothing)

Picture-02

  1. In Column H I show the rest of the string if the word need to be extracted

Picture-03

This is dynamic . as you change the value in Cell F1 it will show you the extracted data accordingly.

Example 1 : with keyword "the" Picture-04

Example 2 : with keyword "is" Picture-05

Example 3 : with keyword "very" Picture-06

Picture-07

Note the Column F is not necessary - you can as well embed this formula into the Column G and Column H formula. I just split it for easier understanding.

  •  Tags:  
  • Related