Home > Forum Home > Developing and Auditing Analytical Models > Concatenate two columns? | Share |
Forum Topic | Post Reply Login |
Concatenate Two Columns? | Rate this: (3/5 from 1 vote) |
Hi, I don't know whether this is the correct place to post my doubt. I am new to this forum. i have a doubt about concatenation. I have two columns with set of words in it. I want to make all the combinations by using those words. For an example, If I have the following words in column A, Alabama Alaska Arizona Texas Washington And in column B, Hotel Theatre If I combine both the columns, I want the output like the following Alabama Hotel Alaska Hotel Arizona Hotel Texas Hotel Washington Hotel Alabama Theatre Alaska Theatre Arizona Theatre Texas Theatre Washington Theatre What is the function i have to use to get this result? Explain me the procedures. I can't do anything manually. Because i have 40 keywords in column A and 15 keywords in column B. I have used the concatenation function already. It takes more time to do. So, i can't use that for getting bulk combinations. Explain me If you have any idea to get the result. Thanks. | ||
Uma | ||
Posted by uma on |
Replies - Displaying 1 to 10 of 13 | Order Replies By: Most Recent | Chronological | Highest Rated |
Rate this: (2.5/5 from 2 votes) If, for example, you have the following spreadsheet: Excel Spreadsheet:
You could then run the following macro to concatenate each possible combination of city and site in column D: VBA Code:
Try opening your VBA editor from Tools >> Macro >> Visual Basic Editor, insert a new module by choosing Insert >> Module and paste the above code in. The macro will now be available from Tools >> Macro >> Macros. | ||||||||||||||||||||||||||||||||
Excel Business Forums Administrator | ||||||||||||||||||||||||||||||||
Posted by Excel Helper on |
Rate this: (3/5 from 1 vote) | |
www.ProjectMatt.com | |
Posted by ProjectMatt on |
Rate this: (3/5 from 1 vote) VBA Code:
| ||
Excel Business Forums Administrator | ||
Posted by Excel Helper on |
Rate this: (3/5 from 3 votes) | |
www.ProjectMatt.com | |
Posted by ProjectMatt on |
Rate this: (3/5 from 1 vote) VBA Code:
This works great as long as there is more than 1 word in each column; However, when there is only one word in either column the macro will run indefinitely (combining words with blank cells). I've tried fixing this using a series of If statements, but I still can't get it to work (or at the very least prompt the user that more than 2 words must be used) Any help that you can offer would be much appreciated. | ||
www.ProjectMatt.com | ||
Posted by ProjectMatt on |
Rate this: (3/5 from 1 vote) VBA Code:
| ||
Excel Business Forums Administrator | ||
Posted by Excel Helper on |
Rate this: (3/5 from 1 vote) | |
www.ProjectMatt.com | |
Posted by ProjectMatt on |
Rate this: (2.5/5 from 2 votes) | |
Posted by keybiscayner on |
Rate this: (3.5/5 from 2 votes) Works great. Need to purchase after 15 days. | |
Posted by keybiscayner on |
Rate this: (3/5 from 1 vote) | |
Excel Business Forums Administrator | |
Posted by Excel Helper on |
Displaying page 1 of 2 | Next |
Find relevant Excel templates and add-ins for Concatenate two columns? in the Excel Business Solutions Directory |