+ Reply to Thread
Results 1 to 12 of 12

Is this Possible? A bit of a brain teaser if you ask me.

  1. #1
    Levi
    Guest

    Is this Possible? A bit of a brain teaser if you ask me.

    I am trying to creat a formula that allows me to change say Smith, John to
    John Smith. However, It must be done using the LEFT, RIGHT, TRIM, LEN, and
    SEARCH functions only. The kicker is that I need it to transfer from one cell
    to another, so CELL:A1 would appear like this: [Smith, John]
    And Cell:A2 would appear like this: [John Smith]
    Is this possible? A friend says yes but I am yet so find a solution. I
    appreciate all replies....I have only been using Excel for about 2 days so I
    am a newbie. Thanks A Lot!

  2. #2
    Ardus Petus
    Guest

    Re: Is this Possible? A bit of a brain teaser if you ask me.

    One way:
    =TRIM(RIGHT(A1,LEN(A1)-FIND(",",A1)))&", "&LEFT(A1,FIND(",",A1)-1)

    HTH
    --
    AP

    "Levi" <[email protected]> a écrit dans le message de news:
    [email protected]...
    >I am trying to creat a formula that allows me to change say Smith, John to
    > John Smith. However, It must be done using the LEFT, RIGHT, TRIM, LEN, and
    > SEARCH functions only. The kicker is that I need it to transfer from one
    > cell
    > to another, so CELL:A1 would appear like this: [Smith, John]
    > And Cell:A2 would appear like this: [John Smith]
    > Is this possible? A friend says yes but I am yet so find a solution. I
    > appreciate all replies....I have only been using Excel for about 2 days so
    > I
    > am a newbie. Thanks A Lot!




  3. #3
    Bob Phillips
    Guest

    Re: Is this Possible? A bit of a brain teaser if you ask me.

    You got two responses to this question yesterday, the one from daddylonglegs
    being especially good IMO. What is wrong with these suggestions?

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Levi" <[email protected]> wrote in message
    news:[email protected]...
    > I am trying to creat a formula that allows me to change say Smith, John to
    > John Smith. However, It must be done using the LEFT, RIGHT, TRIM, LEN, and
    > SEARCH functions only. The kicker is that I need it to transfer from one

    cell
    > to another, so CELL:A1 would appear like this: [Smith, John]
    > And Cell:A2 would appear like this: [John Smith]
    > Is this possible? A friend says yes but I am yet so find a solution. I
    > appreciate all replies....I have only been using Excel for about 2 days so

    I
    > am a newbie. Thanks A Lot!




  4. #4
    Bob Phillips
    Guest

    Re: Is this Possible? A bit of a brain teaser if you ask me.

    Ardus,

    That leaves the comma in which I don't think the OP wanted, but more
    relevantly, it is a very pedantic formula, just like my effort yesterday
    <vbg>. Look at this that daddylonglegs came up,

    =MID(A1&" "&A1,FIND(",",A1)+2,LEN(A1)-1)

    somewhat neater wouldn't you say?

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Ardus Petus" <[email protected]> wrote in message
    news:[email protected]...
    > One way:
    > =TRIM(RIGHT(A1,LEN(A1)-FIND(",",A1)))&", "&LEFT(A1,FIND(",",A1)-1)
    >
    > HTH
    > --
    > AP
    >
    > "Levi" <[email protected]> a écrit dans le message de news:
    > [email protected]...
    > >I am trying to creat a formula that allows me to change say Smith, John

    to
    > > John Smith. However, It must be done using the LEFT, RIGHT, TRIM, LEN,

    and
    > > SEARCH functions only. The kicker is that I need it to transfer from one
    > > cell
    > > to another, so CELL:A1 would appear like this: [Smith, John]
    > > And Cell:A2 would appear like this: [John Smith]
    > > Is this possible? A friend says yes but I am yet so find a solution. I
    > > appreciate all replies....I have only been using Excel for about 2 days

    so
    > > I
    > > am a newbie. Thanks A Lot!

    >
    >




  5. #5
    Ardus Petus
    Guest

    Re: Is this Possible? A bit of a brain teaser if you ask me.

    I misread OP's question and produced a VERY pedantic solution!

    Cheers,
    --
    AP

    "Bob Phillips" <[email protected]> a écrit dans le message
    de news: [email protected]...
    > Ardus,
    >
    > That leaves the comma in which I don't think the OP wanted, but more
    > relevantly, it is a very pedantic formula, just like my effort yesterday
    > <vbg>. Look at this that daddylonglegs came up,
    >
    > =MID(A1&" "&A1,FIND(",",A1)+2,LEN(A1)-1)
    >
    > somewhat neater wouldn't you say?
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (remove nothere from email address if mailing direct)
    >
    > "Ardus Petus" <[email protected]> wrote in message
    > news:[email protected]...
    >> One way:
    >> =TRIM(RIGHT(A1,LEN(A1)-FIND(",",A1)))&", "&LEFT(A1,FIND(",",A1)-1)
    >>
    >> HTH
    >> --
    >> AP
    >>
    >> "Levi" <[email protected]> a écrit dans le message de news:
    >> [email protected]...
    >> >I am trying to creat a formula that allows me to change say Smith, John

    > to
    >> > John Smith. However, It must be done using the LEFT, RIGHT, TRIM, LEN,

    > and
    >> > SEARCH functions only. The kicker is that I need it to transfer from
    >> > one
    >> > cell
    >> > to another, so CELL:A1 would appear like this: [Smith, John]
    >> > And Cell:A2 would appear like this: [John Smith]
    >> > Is this possible? A friend says yes but I am yet so find a solution. I
    >> > appreciate all replies....I have only been using Excel for about 2 days

    > so
    >> > I
    >> > am a newbie. Thanks A Lot!

    >>
    >>

    >
    >




  6. #6
    Bob Phillips
    Guest

    Re: Is this Possible? A bit of a brain teaser if you ask me.

    Don't be hard on yourself, so did I <G>

    Bob

    "Ardus Petus" <[email protected]> wrote in message
    news:[email protected]...
    > I misread OP's question and produced a VERY pedantic solution!
    >
    > Cheers,
    > --
    > AP
    >
    > "Bob Phillips" <[email protected]> a écrit dans le message
    > de news: [email protected]...
    > > Ardus,
    > >
    > > That leaves the comma in which I don't think the OP wanted, but more
    > > relevantly, it is a very pedantic formula, just like my effort yesterday
    > > <vbg>. Look at this that daddylonglegs came up,
    > >
    > > =MID(A1&" "&A1,FIND(",",A1)+2,LEN(A1)-1)
    > >
    > > somewhat neater wouldn't you say?
    > >
    > > --
    > > HTH
    > >
    > > Bob Phillips
    > >
    > > (remove nothere from email address if mailing direct)
    > >
    > > "Ardus Petus" <[email protected]> wrote in message
    > > news:[email protected]...
    > >> One way:
    > >> =TRIM(RIGHT(A1,LEN(A1)-FIND(",",A1)))&", "&LEFT(A1,FIND(",",A1)-1)
    > >>
    > >> HTH
    > >> --
    > >> AP
    > >>
    > >> "Levi" <[email protected]> a écrit dans le message de

    news:
    > >> [email protected]...
    > >> >I am trying to creat a formula that allows me to change say Smith,

    John
    > > to
    > >> > John Smith. However, It must be done using the LEFT, RIGHT, TRIM,

    LEN,
    > > and
    > >> > SEARCH functions only. The kicker is that I need it to transfer from
    > >> > one
    > >> > cell
    > >> > to another, so CELL:A1 would appear like this: [Smith, John]
    > >> > And Cell:A2 would appear like this: [John Smith]
    > >> > Is this possible? A friend says yes but I am yet so find a solution.

    I
    > >> > appreciate all replies....I have only been using Excel for about 2

    days
    > > so
    > >> > I
    > >> > am a newbie. Thanks A Lot!
    > >>
    > >>

    > >
    > >

    >
    >




  7. #7
    Marti
    Guest

    Re: Is this Possible? A bit of a brain teaser if you ask me - Followup question, Marti

    This is great! Is it possible to do the reverse, change Joe Smith
    into Smith, Joe?

    Thanks, Marti

    On Tue, 2 May 2006 10:16:35 +0100, "Bob Phillips"
    <[email protected]> wrote:

    >Ardus,
    >
    >That leaves the comma in which I don't think the OP wanted, but more
    >relevantly, it is a very pedantic formula, just like my effort yesterday
    ><vbg>. Look at this that daddylonglegs came up,
    >
    >=MID(A1&" "&A1,FIND(",",A1)+2,LEN(A1)-1)
    >
    >somewhat neater wouldn't you say?


  8. #8
    Forum Contributor
    Join Date
    12-04-2003
    Posts
    360
    Yes. Use the same logic as daddylonglegs uses. Search for the space in the string and return using the relative lengths and positions of the forename and surname.
    Last edited by MattShoreson; 05-02-2006 at 09:48 AM.

  9. #9
    Ardus Petus
    Guest

    Re: Is this Possible? A bit of a brain teaser if you ask me - Followup question, Marti

    =RIGHT(A1,LEN(A1)-SEARCH(" ",A1))&", "&LEFT(A1,SEARCH(" ",A1)-1)

    HTH
    --
    AP

    "Marti" <[email protected]> a écrit dans le message de news:
    [email protected]...
    > This is great! Is it possible to do the reverse, change Joe Smith
    > into Smith, Joe?
    >
    > Thanks, Marti
    >
    > On Tue, 2 May 2006 10:16:35 +0100, "Bob Phillips"
    > <[email protected]> wrote:
    >
    >>Ardus,
    >>
    >>That leaves the comma in which I don't think the OP wanted, but more
    >>relevantly, it is a very pedantic formula, just like my effort yesterday
    >><vbg>. Look at this that daddylonglegs came up,
    >>
    >>=MID(A1&" "&A1,FIND(",",A1)+2,LEN(A1)-1)
    >>
    >>somewhat neater wouldn't you say?




  10. #10
    Forum Contributor
    Join Date
    12-04-2003
    Posts
    360
    or you could have used...

    =MID(A1&", "&A1,FIND(" ",A1)+1,LEN(A1)+1)

  11. #11
    Ardus Petus
    Guest

    Re: Is this Possible? A bit of a brain teaser if you ask me.

    You already knew I'm a brain-twister (unknowing of anybody elses's
    solutions)

    Cheers,
    --
    AP

    "MattShoreson" <[email protected]> a
    écrit dans le message de news:
    [email protected]...
    >
    > or you could have used...
    >
    > =MID(A1&", "&A1,FIND(" ",A1)+1,LEN(A1)+1)
    >
    >
    > --
    > MattShoreson
    > ------------------------------------------------------------------------
    > MattShoreson's Profile:
    > http://www.excelforum.com/member.php...fo&userid=3472
    > View this thread: http://www.excelforum.com/showthread...hreadid=537972
    >




  12. #12
    Marti
    Guest

    Re: Is this Possible? A bit of a brain teaser if you ask me - Followup question, Marti

    Thanks so much! This is like magic!

    Marti

    On Tue, 2 May 2006 15:50:43 +0200, "Ardus Petus"
    <[email protected]> wrote:

    >=RIGHT(A1,LEN(A1)-SEARCH(" ",A1))&", "&LEFT(A1,SEARCH(" ",A1)-1)


+ 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