• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Extract String From A Cell and Display

Hello,
I have two columns in a table Materials Plant and Materials. I am trying to extract only a string from Materials Plant column to Materials column

Example:
I have PEAGRAVEL in Materials Plant column but the formula that I got only extracts GRAVEL to the Materials column

I have attached the spreadsheet.

Thanks in advance
 

Attachments

  • new_haulers_template.xlsx
    28.4 KB · Views: 8
Try,

K8, copied down :

=IF(ISNUMBER(SEARCH(" GRAVEL "," "&[@[MATERIAL EXTRACT]]&" ")),"GRAVEL",IF(ISNUMBER(SEARCH(" SAND "," "&[@[MATERIAL EXTRACT]]&" ")),"SAND",IF(ISNUMBER(SEARCH(" PEAGRAVEL "," "&[@[MATERIAL EXTRACT]]&" ")),"PEAGRAVEL","NO")))

Regards
Bosco
 
How about
=IFERROR(LEFT([@[MATERIAL EXTRACT]], SEARCH(" ", [@[MATERIAL EXTRACT]])-1), "NO")
 
= LOOKUP( 1, 1 / (SEARCH(material,[@[MATERIAL EXTRACT]]) = 1), material)

This starts with naming a list of the (three) material options. The material extract field is searched for each material as an array and tested against 1 (leftmost character). LOOKUP returns the valid material from the list.
 

Attachments

  • multiple option search.xlsx
    28.1 KB · Views: 5
= LOOKUP( 1, 1 / (SEARCH(material,[@[MATERIAL EXTRACT]]) = 1), material)

This starts with naming a list of the (three) material options. The material extract field is searched for each material as an array and tested against 1 (leftmost character). LOOKUP returns the valid material from the list.
Or...............

=LEFT([@[MATERIAL EXTRACT]], SEARCH(" ", [@[MATERIAL EXTRACT]]&" ")-1)

Regards
Bosco
Thanks Mr. Bosco. All your solutions worked. Thanks again
 
Or...............

=LEFT([@[MATERIAL EXTRACT]], SEARCH(" ", [@[MATERIAL EXTRACT]]&" ")-1)

Regards
Bosco

Mr. Bosco
Need your help again.
I am trying extract just the vendor name from MATERIAL PLANT VENDOR field to VENDOR field

example:
SAND PL 01 -BALDWIN REDI MIX from this I only need text after the dash or hyphen BALDWIN REDI MIX. It should extract any data after the dash or hyphen

I have attached the spreadsheet.

Thanks again
 

Attachments

  • haulers_template.xlsx
    19.3 KB · Views: 6
Mr. Bosco
Need your help again.
I am trying extract just the vendor name from MATERIAL PLANT VENDOR field to VENDOR field

example:
SAND PL 01 -BALDWIN REDI MIX from this I only need text after the dash or hyphen BALDWIN REDI MIX. It should extract any data after the dash or hyphen

I have attached the spreadsheet.

Thanks again

Try,

In I6, copied down :

=MID([@[MATERIAL PLANT VENDOR]],SEARCH("-",[@[MATERIAL PLANT VENDOR]]&"-")+1,99)

or,

=SUBSTITUTE([@[MATERIAL PLANT VENDOR]],[@[MATERIALS PLANTS]]&" -","")

Regards
Bosco
 
Last edited:
Back
Top