+ Reply to Thread
Results 1 to 13 of 13

Picking two columns of data and combining

  1. #1
    Forum Contributor
    Join Date
    11-13-2010
    Location
    Warren, Michigan
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    307

    Picking two columns of data and combining

    I would like to pickup two columns of numbers (text formatted), combining together and place in another column.

    Example: (The columns go from row 9 through 49)

    Column M has 7 numbers with blank cells in between numbers, and Column U has 11 numbers also with blank cells in between numbers.

    I want to combine both columns (total of 18 numbers) in Column AA with no blanks.

    I know this has probably been answered some where on the forum but I cannot find it.

    Any suggestions?
    Last edited by khank; 01-14-2011 at 05:31 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Picking two columns of data and combining

    tRY:

    =SUBSTITUTE(M1&U1," ","")

    Where M1 and U1 are first numbers to combine

    If you want the result to be an actual number you can use in formulas.. then try

    =SUBSTITUTE(M1&U1," ","")+0
    Last edited by NBVC; 01-14-2011 at 09:34 AM.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

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

    Re: Picking two columns of data and combining

    @NBVC, I think the issue here is one of no interspersed blanks.

    It's a shame the numbers are stored as text else you could use a basic LARGE configuration ... you still can but you'd need to use via an Array to coerce
    [assumes numbers can be returned in numerical order rather than the order in which they appear]

    (obviously given XL2008 you have no VBA support)

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Picking two columns of data and combining

    I misread the question... I didn't realize it was blank cells.. I thought the cells themselves had numbers with some blank spaces..between.... I guess my coffee hasn't kicked in this morning

  5. #5
    Forum Contributor
    Join Date
    11-13-2010
    Location
    Warren, Michigan
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    307

    Re: Picking two columns of data and combining

    =A1&" "&B1 formula works great except when I have a number on the "same" row in a different column. See sample, plus it still has blanks between numbers.

    (The reason I'm not using general or number formatting is when numbers start with 0's I end up losing the zero - so to hang onto the zeros I changed the format to "text".)
    Attached Files Attached Files

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Picking two columns of data and combining

    In the sample...try:

    Please Login or Register  to view this content.
    confirmed with CTRL+SHIFT+ENTER not just ENTER and copied down.

    This lists column A numbers first, then column B numbers below with no blanks...not sure if that is acceptable or not...
    Last edited by NBVC; 01-14-2011 at 01:50 PM.

  7. #7
    Forum Contributor
    Join Date
    11-13-2010
    Location
    Warren, Michigan
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    307

    Re: Picking two columns of data and combining

    The array works beautifully on the sample.

    When I went to my "real" file and the columns in contention are Column M9:M59 and Column U9:U59 the array works in Column AG9:AG59 except there's a large number of rows (approximately 15 rows) with blanks then numbers.

    What appears to be happening is the formula is picking up Column M rows of blanks then Column U.
    Please Login or Register  to view this content.
    Or is it this array needs to start at Row 1?
    Last edited by NBVC; 01-14-2011 at 02:36 PM. Reason: added code tags to make formula fit screen width

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Picking two columns of data and combining

    This part: ROWS($M$8:$M8) both times should be $M$1:M$1 at the cell you first enter the formula in: Then confirm with CSE keys and copy down

    Also check that the blank cells are truly blank and that someone didn't enter spaces with the spacebar...

  9. #9
    Forum Contributor
    Join Date
    11-13-2010
    Location
    Warren, Michigan
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    307

    Re: Picking two columns of data and combining

    Did the change but the same thing happened. The gap between the numbers is where Column M numbers ended then running "blank" cells down to M59 and at M60 Column U numbers begin running down.

    FYI: I cleared everything from Column U and started over with the array and copying down.

    It works great and the problem is solved except for the gap of blank cells...I don't know what is causing that, if I have to live with that I can.

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Picking two columns of data and combining

    I just tried your sample, by placing the items in column A at M9 and the items in B at U9 and ran the formula:

    Please Login or Register  to view this content.
    CSE confirmed and copied down.

    There are alot of blanks in the bottom part of column M, but those don't show up in the formula column.. it goes smoothly from last number in M to first number in U.

    If you want attach the actual workbook deleting all columns except M and U....and I could verify.

    The only way I get those gaps is if I enter a space in some cells in column M...

    Try going to the cell after the last number in column M and just press delete. Then copy that blank cell down to M59.. now is the result still the same?
    Last edited by NBVC; 01-14-2011 at 04:11 PM.

  11. #11
    Forum Contributor
    Join Date
    11-13-2010
    Location
    Warren, Michigan
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    307

    Re: Picking two columns of data and combining

    I've attached a sample worksheet.

    I just removed all none essential columns and text. I don't know where I went wrong.

    To me this is a "workaround" to what I'm trying to do, which is picking up only one duplicate along with each "good" number and place under respective number in Column N, Column O and Column P.

    In column R is the formula I'm trying to get to work. What I'm doing is then "copying" the number and manually placing under the respective number in Column N, Column O and Column P.

    Thanks for your help.
    Attached Files Attached Files

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Picking two columns of data and combining

    Ok, you have formulas that produce nulls... therefore use:

    Please Login or Register  to view this content.


    This part:

    COUNTIF($H$9:$H$59,"?*") changes and accounts for counting items in a range excluding formula blanks.

  13. #13
    Forum Contributor
    Join Date
    11-13-2010
    Location
    Warren, Michigan
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    307

    Re: Picking two columns of data and combining

    Perfect! Thanks for all your help. I will mark this "SOLVED".

+ 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