+ Reply to Thread
Results 1 to 5 of 5

concatenate 3 cells based on condition

  1. #1
    Forum Contributor
    Join Date
    05-13-2009
    Location
    London, England
    MS-Off Ver
    Excel XP
    Posts
    174

    concatenate 3 cells based on condition

    Hi guys, need some help again,

    In the workbook, 3 columns of importance
    Column N,S and AC

    Concatenate order ("S"&"N"&"AC") - combine it and show value in column AG

    Column AC has either 0 or any other number (50,60,100 etc). If it is 0 I need to insert an 'F' at the end of the code in column AG, any other numbr and i need an 'O'.

    Column N has contract code, this will be in the middle, usually its alphabets like RF,EF, but sometimes numbers like 21,33, etc but when its a single digit number like 6, i need it changed to 06 (need the 0 infront)

    Column S has exchange codes, and this has to appear in the front of the code in Column AG. Same as Column N, if there is a single digit number then put a 0 infront of it.

    I have shown the desired solutions for some of the cotracts in the file so it should be easy to understand what i need.


    any advice?

    thanks lot
    Attached Files Attached Files
    Last edited by Pasha81; 11-02-2009 at 08:55 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: concatenate 3 cells based on condition

    One approach

    AG2: =TEXT($S2,"00")&TEXT($N2,"00")&IF($AC2,"O","F")
    copied down

  3. #3
    Forum Contributor
    Join Date
    05-13-2009
    Location
    London, England
    MS-Off Ver
    Excel XP
    Posts
    174

    Re: concatenate 3 cells based on condition

    thanks Don, that works beautifully
    now one question, working backwards - if i had the solution
    e.g 06RSF, how would i delete the 1st 2 digits and the last digit so that only 'RS' remains.

    I'll mark it solved as you've alrdy answered my original question

    Thanks

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: concatenate 3 cells based on condition

    You can use MID

    =MID(string,3,2)

    ie extract 2 characters from string starting from character 3.... where string can be a constant or a cell reference to the string in question.

  5. #5
    Forum Contributor
    Join Date
    05-13-2009
    Location
    London, England
    MS-Off Ver
    Excel XP
    Posts
    174

    Re: concatenate 3 cells based on condition

    brilliant, thanks again!

+ 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