+ Reply to Thread
Results 1 to 13 of 13

Can I use Concatenate function for diff amunts of cells that need to be pulled together?

  1. #1
    Registered User
    Join Date
    08-08-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    10

    Question Can I use Concatenate function for diff amunts of cells that need to be pulled together?

    Hi all,

    I am trying to pull information together, by using the concatinate function, but I'm not even sure if it is possible to do so.

    Let's say I have:

    A1 - text B1 - number
    A2 - Blank B2 - number
    A3 - text B3 - number
    A4 - Blank B4 - number
    A5 - Blank B5 - number

    What i need to do is pull the numbers in B1 & B2 together into B1, and numbers in B3, B4 & B5 into B3. The question is, can i actually do that? Since there is a different amount of blank cells between the cells that contain text. I know you're thinking that I could do it manually, but trust me this goes on up to A3000 or something.

    Aaand on top of that, not all the rows that have blanks in column A have numbers in column B... soo yeah.

    If anyone knows how to do this, please please please tell me!! That would be such a big help.
    And even if it is impossible to do that, does anyone have any suggestions of how to make it simpler? Cause I think it would take a looong time to go through over 3000 rows and pull them together.

    Thanks everyone

  2. #2
    Registered User
    Join Date
    08-08-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Can I use Concatenate function for diff amunts of cells that need to be pulled togethe

    Since no one replied, I assume it's impossible. Oh the joy of excell....

  3. #3
    Forum Contributor
    Join Date
    07-02-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    197

    Re: Can I use Concatenate function for diff amunts of cells that need to be pulled togethe

    You cannot create a formula for a cell containing a value to replace the existing value.

    Then you must use a helper column.

    Can you post a small sample of your spreadsheet?

  4. #4
    Registered User
    Join Date
    08-08-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Can I use Concatenate function for diff amunts of cells that need to be pulled togethe

    Thank you so much for replying!!!

    That's what i thought too about replacing values.. and there is no problem with using a helper column, but the difficult part is to make them concatenate, I am really struggling.

    My spreadsheet goes something like this: (I changed the information, this is just an idea of how it is supposed to be, I just pasted it straight on here if you don't mind)


    Code Name Number
    100000 AAA
    5678
    9102

    100001 BBB 4567

    2345
    100002 CCC
    1234
    8910

    2345
    5678

    Thank You

  5. #5
    Registered User
    Join Date
    08-08-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Can I use Concatenate function for diff amunts of cells that need to be pulled togethe

    Crap, it posted it all funny, sorry!!!
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    07-02-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    197

    Re: Can I use Concatenate function for diff amunts of cells that need to be pulled togethe

    This is a solution with a helper column.

    The data is concatenated with a user defined formula named "concat". This is defined in the VBA monitor. Type alt+F11 to see the code.

  7. #7
    Registered User
    Join Date
    08-08-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Can I use Concatenate function for diff amunts of cells that need to be pulled togethe

    Thank you very much for your help, but I think you missunderstood me. You concatinated the columns "code", "name" and "number".

    But I wanted to only concatinate the numbers. For example if you refer to my sample, I would want the information in cells C2, C3, C4 and C5 to be together in one cell. And I would want to do this for every code.

    I have actually progressed, I used this formula:

    =IF(A2=0," ",SUBSTITUTE(TRIM(C2&" "&C3&" "&C4&" "&C5)," "," , "))

    It works beatifully, as it ignores the blanks and only uses the formula where there is a code present. BUT my biggest problem is still not solved. In my formula I used four of the cells: (C2&" "&C3&" "&C4&" "&C5) but as you know in other cases there are more or less than four cells that contain numbers which need to be pulled together!

    Aaargh this is so frustrating! I will try to play around with the IF function and see if anything happens...
    Thank you very very much for this though!! I appreciate your help

    If anyone has any suggestions, please help, and tell me if I'm not being clear enough Thank You.

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Can I use Concatenate function for diff amunts of cells that need to be pulled togethe

    Hi

    Im not going to do the whol thing, but try this...

    =IF(A2=0," ",SUBSTITUTE(TRIM(IF(ISTEXT(C2),"",C2)&" "&C3&" "&C4&" "&C5)," "," , "))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  9. #9
    Registered User
    Join Date
    08-08-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Can I use Concatenate function for diff amunts of cells that need to be pulled togethe

    Hi,

    Thank You for replying!!

    I tried it, but it still didn't solve the problem. :/

    It works in the same way my formula does, if there are more than four numbers, then the formula still doesn't include them.If there are 3 numbers then the formula uses a number from the next code.

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Can I use Concatenate function for diff amunts of cells that need to be pulled togethe

    It's not including more than 4, because thats all there is in the formula.

    can you upload a sample workbook with a few samples of dummy info in it?

  11. #11
    Registered User
    Join Date
    08-08-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Can I use Concatenate function for diff amunts of cells that need to be pulled togethe

    Hi,

    I know that there are only four cells in the formula, but I'm not sure if you can change the number automatically.
    Because I would have to change the number of the cells for every code there is, and there is a lot.

    I think that what I am trying to achieve is impossible, because excel would have to recognise that a different code has started, and change the formula.

    And I did upload the sample spreadsheet..

  12. #12
    Registered User
    Join Date
    08-08-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Can I use Concatenate function for diff amunts of cells that need to be pulled togethe

    Is there any way of typing into the formula; use cells such and such, up until there is a number in column A; or something like that??

  13. #13
    Registered User
    Join Date
    08-08-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Can I use Concatenate function for diff amunts of cells that need to be pulled togethe

    I almost figured it out, I used this formula:

    =IF(A4=0,IF(A3=0,IF(A2=0," ",SUBSTITUTE(TRIM(C2&" "&C3&" "&C4&" "&C5)," "," , ")),SUBSTITUTE(TRIM(C2)," "," , ")),SUBSTITUTE(TRIM(C2&" "&C3)," "," , "))

    And I wanted to add: =IF(A5=0...... etc. But the formula is too long and it wont let me..

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Avg values for multiple cells pulled from named list...?
    By rtilghman in forum Excel General
    Replies: 3
    Last Post: 02-03-2010, 11:43 AM
  2. Function to list data pulled from 2-D Array
    By nscottwerner in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-19-2009, 06:08 PM
  3. Using Function to Concatenate Cells
    By mridzuani in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-29-2009, 06:02 AM
  4. [SOLVED] Combine 2 cells without using the CONCATENATE function
    By JBG in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-19-2006, 06:40 PM
  5. [SOLVED] Refreshing Data Pulled Thru a Function
    By Chris Brown in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-09-2005, 03:05 PM

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