+ Reply to Thread
Results 1 to 5 of 5

Separate text will be in other cell

  1. #1
    Registered User
    Join Date
    05-08-2024
    Location
    riyadh
    MS-Off Ver
    MS365 Version 2403
    Posts
    9

    Separate text will be in other cell

    Dear Sir / Madam,

    Is there any way to extract the text to the other column. thank you for the help.
    Attached Files Attached Files

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,636

    Re: Separate text will be in other cell

    IMHO, any solution will have lot of possible errors.

    Input is very inconsistent.

    For example, it would be easier if DR. is always with .
    In your case you have sometimes DR without .

    Clinic is in some cases separated with - in some with ( and if in case clinic appear with space then it would be impossible to determine what is doctor name and what is clinic.

    First you should work on consistent entry.

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,636

    Re: Separate text will be in other cell

    This could work for doctor (with . ) and clinic:

    =TEXTAFTER(LOOKUP(REPT("Z",255),$D$6:$D7),"DR.")

    This could work for clinic:

    =TRIM(MID(LOOKUP(REPT("Z",255),$D$6:$D7),4+MIN(SEARCH(CHAR(SUBSTITUTE(ROW($A$33:$A$47),42,33)),SUBSTITUTE(LOOKUP(REPT("Z",255),$D$6:$D7),"DR.","")&CHAR(SUBSTITUTE(ROW($A$33:$A$47),42,33)))),255))

    Need more time to figure out how to extract just doctor name...
    Plus "if theres no clinic will be result N/A" part.. I got blank for now...
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-08-2024
    Location
    riyadh
    MS-Off Ver
    MS365 Version 2403
    Posts
    9

    Re: Separate text will be in other cell

    Thanks Mr. Zbor for the help sir, i know the data is frustrating and inconsistent sorry for that . But any solution even theres error , are accepted. Thank you god bless you all . .

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,636

    Re: Separate text will be in other cell

    I've also made this UDF so you can test it:


    Use 1 to extract Doctor and 2 to extract Clinic


    in E7:

    =ExtractName(LOOKUP(REPT("Z",255), $D$6:$D7), 1)

    in F7:

    =ExtractName(LOOKUP(REPT("Z",255), $D$6:$D7), 2)

    Extending formula down is hard due to merged cells...
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 12-02-2022, 06:01 AM
  2. Replies: 3
    Last Post: 04-20-2020, 12:38 PM
  3. [SOLVED] 2 cell text lookup in text string to return data from separate column
    By Zivhodiva in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-08-2019, 03:03 PM
  4. [SOLVED] Separate Text in one cell into 3 separate cells
    By Kathleen N in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 05-30-2018, 04:43 PM
  5. [SOLVED] Separate text in cell by specific value/text
    By Ssaamirr in forum Excel General
    Replies: 34
    Last Post: 04-25-2014, 05:50 AM
  6. Search cell for multiple text , return comma separated text in separate cell if found
    By dangerdoug in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2013, 01:52 PM
  7. [SOLVED] Splitting text from one cell into separate text fragments, Located in adjacent cells
    By onsid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-15-2013, 08:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1