+ Reply to Thread
Results 1 to 2 of 2

Joining strings if cells have data

Hybrid View

English_Bloke82 Joining strings if cells have... 04-06-2011, 05:14 AM
Domski Re: Joining strings if cells... 04-06-2011, 05:30 AM
  1. #1
    Registered User
    Join Date
    03-19-2010
    Location
    Felixstowe
    MS-Off Ver
    Excel 2003
    Posts
    34

    Joining strings if cells have data

    Hi,

    Bit of an horrible one, sorry. I am compiling a comparison spreadsheet at the moment as part of a electronic migration process. Whilst most of the fields are the same, there is one less address line in the new application that the old. New app has 4 lines, old has 5.

    My problem is that I need to join two cells together with a comma in if the cells both have data, but not if only address line 4 does. I tried =A1&", "&A2 but this leaves the comma in and therefore will fail on the exact formula later. I thought I could use a length -2 if a comma and a space were detected at the end but I got stuck. Any help would be great. Many Thanks

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Joining strings if cells have data

    Guess something like this:

    =A1&IF(A2<>"",", "&A2,"")

    Dom

    Dom
    Last edited by Domski; 04-06-2011 at 05:34 AM.
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

+ 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