+ Reply to Thread
Results 1 to 3 of 3

Help needed with formula to consolidate data for mailmerge email list

  1. #1
    Registered User
    Join Date
    06-27-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    2

    Unhappy Help needed with formula to consolidate data for mailmerge email list

    Hi guys, I could really use some help!

    Owing to the need to send customers codes via email, and email software's restrictions to one email per recipient in a mailmerge, I am trying to create a formula which will, for any customer who needs to receive more than one code, put all instances of the code into the same cell. For any customer who only needs one code, it just outputs that code.

    I will then have a separate formula which identifies which rows are redundant, so I can filter them out and end up with a list with just one row per customer, with all their codes together in the same cell.

    I have run into some problems with the initial formula, and am frankly stuck. It seems to be almost working, but is producing some odd errors. I've attached a sample file with some mock email addresses and codes in columns A and B respectively, and the formula and its output in column C.

    Oddities:
    • The first customer in the sample should be getting 20 codes (from CODE A-1 to CODE A-20). Instead they are also getting a code belonging to the next customer (CODE B-1). This same error occurs for the 2nd customer, who gets CODE C-1 from the list meant to go to the 3rd customer, and so on. I've no doubt this is caused by something stupidly simple, but I just can't see where in the formula this is happening! Maybe I've been staring at this formula too long!
    • Why ON EARTH has the formula in cell C3 returned "FALSE"? Why doesn't this happen anywhere else?

    I would be really appreciative if someone with more experienced eyes could take a look and see if they can figure out where I've gone wrong.

    And here is the monstrous formula meant to accomplish the task:

    Please Login or Register  to view this content.
    Thank you so much.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    12-03-2012
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2010, 2013, 2016
    Posts
    41

    Re: Help needed with formula to consolidate data for mailmerge email list

    You can use a UDF

    Use a formula like this: =ConcatenateIf(Sheet3!A:A,Sheet1!A2,Sheet3!B:B) 'Separator is omitted hear so a comma is used
    Syntax = Concatenateif(CriteriaRange,Criteria,ConcatenateRange, Optional Separator)

    Not sure where this code originated but, this is the second time I have posted it as a thread answer within a week....looks pretty useful

    Please Login or Register  to view this content.
    1. Alt + F11
    2. Insert Module
    3. Paste above code in a code module.
    4. Use as a workbook formula
    Using Excel 2010, 2013 & 2016 | Windows 7 | 64 Bit

  3. #3
    Registered User
    Join Date
    06-27-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    2

    Red face Re: Help needed with formula to consolidate data for mailmerge email list

    Hi mrmmickle1!

    Thanks so much for your help.

    I did have some trouble with this formula as written but after some playing around I managed to come up with something based on it which accomplishes what I need.

    You've saved my bacon! I've given you some well deserved reputation.

    Thanks again.

+ 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. Populate Mailmerge word document from list of excel data
    By sthiru in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-17-2016, 02:33 AM
  2. Help needed to consolidate & track a list of names!
    By NorthernRedwood in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-01-2015, 06:11 AM
  3. [SOLVED] Mailmerge macro changes needed
    By aganesan99 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-31-2013, 04:30 AM
  4. Replies: 12
    Last Post: 01-31-2013, 03:30 PM
  5. [SOLVED] formula needed to copy same set of data from cells into a list
    By will2k in forum Excel General
    Replies: 1
    Last Post: 12-04-2012, 03:23 AM
  6. Replies: 11
    Last Post: 02-10-2011, 08:13 AM
  7. [SOLVED] mailmerge to a word document from email addresses in a single cell of an excel sheet
    By junoon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-14-2006, 10:20 AM

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