+ Reply to Thread
Results 1 to 4 of 4

Swap if

  1. #1
    Forum Contributor
    Join Date
    05-12-2009
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    219

    Swap if

    Hi all,
    I need a program that can help me for the following: I have two column of numbers (col 1 and col 2), If the first digit of any number from col2 is greater than 1 then swap content of that cell with the corresponding cell in col 1.

    Ex: 11156 67234 -> 67234 11156

    Thanks,
    VBisgreat
    Last edited by Leith Ross; 04-19-2011 at 02:40 PM.

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Swap if

    Assuming values are in the A and B columns:
    Please Login or Register  to view this content.
    Last edited by tlafferty; 04-26-2011 at 08:05 PM.

  3. #3
    Forum Contributor
    Join Date
    05-12-2009
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    219

    Re: Swap if

    Thank you very much!
    Is there a way to make corresponding data in col C and D swap as well when the above condition (for col 1 and 2) is met?

    I meant swab A <-> B and C<->D If the first digit of any number from col2 is greater than 1

    VBisgreat!
    Last edited by VBisgreat; 04-21-2011 at 03:45 PM.

  4. #4
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Swap if

    This should do the trick:
    Please Login or Register  to view this content.

+ 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