+ Reply to Thread
Results 1 to 8 of 8

Merging Cell Values

  1. #1
    Registered User
    Join Date
    05-04-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Merging Cell Values

    hi All

    I have a gazzeteer list (a list of distances from area to area), please review the attached document.

    I need to import these values into a database, so need to change the cells into the following format:

    column1 column2 Distance
    ADE ALB 1000
    ADE ALT 500
    ALB ADE 1000
    ALB ALT 600
    ALT ADE 500
    ALT ALB 600
    etc
    I hope this makes sense?

    I know I need a macro of sorts, but not sure how/where to start

    Thanks
    Attached Files Attached Files
    Last edited by Sebastiens; 05-04-2010 at 08:49 PM.

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Merging Cell Values

    Hello & Welcome to the forum,

    Take a look at sheet2...this can be done with a formula.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-04-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Merging Cell Values

    Thanks Jeffrey
    Thats pretty close, but I was hoping to auto match the vertical & horizontal ranges.
    The reason is that there are 82 different zones, which would result in 6000+ matches.
    Does this make sense?

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Merging Cell Values

    The index/match does exactly that...

    Matches ADE which is in B3 and matches ALB which is in E2 and returns 868.

    Can you give a good example of what you want returned because honestly I didn't see any matched in your example and the spreadsheet was void of and outcomes?

  5. #5
    Registered User
    Join Date
    05-04-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Merging Cell Values

    I can see that index/match works a treat. the issue I have is this:
    I have a list of zones (82 of them). Each zone needs to be matched to each zone.
    for example:
    in column A I have ADE copied down 81 times
    in column B I have each other zone
    in column C i would then use the index/match that you've shown me to find the distance

    the question I now have is, is there a way to automatically create the A & B columns?

    i think I'm confusing you, but it's a little difficult to explain what it in writing

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Merging Cell Values

    Yes maybe slightly, but you had the 100% right idea, provide a sample workbook but unfortunately all of the info was not provided up front.

    Can you work up a small sample workbook with all of your requirements and some results so we can ensure the right answer is provided?

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Merging Cell Values

    This may work for you, click the button to run the macro, when it is finished, check it out on Sheet2.
    It also removes the rows with zeros and the blanks that occur from the formula.
    Attached Files Attached Files
    Last edited by davesexcel; 05-04-2010 at 11:35 PM.

  8. #8
    Registered User
    Join Date
    05-04-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Merging Cell Values

    Dave, I'm not sure what you did, but PERFECT! thanks mate.

+ 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