+ Reply to Thread
Results 1 to 6 of 6

USE A Function to retrieve text on different lines in cell

  1. #1
    Forum Contributor
    Join Date
    11-13-2015
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    831

    USE A Function to retrieve text on different lines in cell

    Hi guys

    I have an export to csv from SQL which is showing text in multiple rows like this in each cell:


    =---
    - spam

    Is there any formula someone can tell me where I 'trim' or reduce the first line and only have the value "- spam" returned?

    Thanks!

    P.s file attached - you might need to drag the formula bar down
    Attached Files Attached Files
    Last edited by rayted; 03-13-2019 at 07:01 AM.
    Thanks,

    R.



  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,929

    Re: USE A Function to retrieve text on different lines in cell

    Your file that you attached does not contain any examples of what you describe in your post. Suggest you post a sample that is a true representation of your issue.

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    11-13-2015
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    831

    Re: USE A Function to retrieve text on different lines in cell

    Quote Originally Posted by alansidman View Post
    Your file that you attached does not contain any examples of what you describe in your post. Suggest you post a sample that is a true representation of your issue.

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Hi Alan,

    Hi

    Please see attached the same file

    As mentioned this output has been taken from SQL and exported to a CSV file.

    However, I am struggling with the fact I have to expand the 'formula bar' to read the text in cell A2.

    As you can see (if you expand the formula bar) there are two lines:

    =--- (on line 1)
    - spam (on line 2)

    I want to use a function like trim/left or whatever to retrieve the text from line 2.

    Can you advise please?
    Attached Files Attached Files

  4. #4
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: USE A Function to retrieve text on different lines in cell

    When you open this CSV in excel you've got data in cols A-D, right.
    So put into E2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and drag it down.

    if you want to replace values in column A you have to use VBA.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  5. #5
    Forum Contributor
    Join Date
    11-13-2015
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    831

    Re: USE A Function to retrieve text on different lines in cell

    Quote Originally Posted by KOKOSEK View Post
    When you open this CSV in excel you've got data in cols A-D, right.
    So put into E2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and drag it down.

    if you want to replace values in column A you have to use VBA.
    Awesome it works!

  6. #6
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: USE A Function to retrieve text on different lines in cell

    You welcome.
    Thanks for Rep.

+ 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. IF Statement: After certain dates, retrieve several lines of text
    By c.mayer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-23-2014, 10:48 AM
  2. [SOLVED] Wrap text ceases to function in Excel if cell exceeds 9 lines
    By JE McGimpsey in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 07:05 AM
  3. [SOLVED] Wrap text ceases to function in Excel if cell exceeds 9 lines
    By nycemail in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  4. Wrap text ceases to function in Excel if cell exceeds 9 lines
    By nycemail in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  5. Wrap text ceases to function in Excel if cell exceeds 9 lines
    By nycemail in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  6. [SOLVED] Wrap text ceases to function in Excel if cell exceeds 9 lines
    By nycemail in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  7. [SOLVED] Wrap text ceases to function in Excel if cell exceeds 9 lines
    By nycemail in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-24-2005, 02:05 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