+ Reply to Thread
Results 1 to 5 of 5

Splitting 2 values in once cell to 2 other cells

  1. #1
    Registered User
    Join Date
    05-20-2009
    Location
    Switzerland
    MS-Off Ver
    Excel 365
    Posts
    45

    Splitting 2 values in once cell to 2 other cells

    I have a database in which I have a cell in which 2 values are entered in one cell but seperated by a pipe '|' sign

    to calculate with these values I need to extract those values into 2 new cells

    example :

    A1 : 1000,00 | 895,45

    Should go to 2 new fields as shown below

    B1 : 1000,00
    C1 : 895,45

    Can someone help me with this one ?

    What happens if there is no entry before or after the pipe sign ?
    Is it then possible to show a zero in one of the new cells (B1 or C1) ?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Splitting 2 values in once cell to 2 other cells

    Use the Data > Text To Columns feature.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

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

    Re: Splitting 2 values in once cell to 2 other cells

    Select all (Ctrl+A or column A)
    Replace (Ctrl+H) space with nothing
    Close
    Data -> Text to column -> Delimiter
    Write | for delimiter
    Finnish

  4. #4
    Registered User
    Join Date
    05-20-2009
    Location
    Switzerland
    MS-Off Ver
    Excel 365
    Posts
    45

    Re: Splitting 2 values in once cell to 2 other cells

    What I perhaps should have told is that the data is coming from a database via an ODBC query where the data is being using in a pivot table.
    This is why I look for a formula rather than a manual correction

    Is this not something that can be done via a formula ?

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Splitting 2 values in once cell to 2 other cells

    =LEFT(A1,FIND("|",A1)-1) and =MID(A1,FIND("|",A1)+1,255) you may need to put ; instead of ,
    Last edited by martindwilson; 02-06-2011 at 09:58 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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