+ Reply to Thread
Results 1 to 7 of 7

If formula with many different outcomes and also to combine names for a mail merge

  1. #1
    Registered User
    Join Date
    09-26-2012
    Location
    Hackney
    MS-Off Ver
    Excel 2010
    Posts
    4

    If formula with many different outcomes and also to combine names for a mail merge

    HI,

    I have recently updated out company database to include insurance details and mailing details for customers. Database was the easy part it seems now I have to get a report to run off it which works perfect I just cant figure out an easy way for it to filter out deceased parties and create a name mail merge as required.

    IE I have Vendor1 & Vendor 2 (Column A & Column B) both details on the system , I also have dates deceased ( Column S & Column T) So there are various outcomes to this scenario ... ONe Vendor , Two Vendors , One Alive , Two Alive , Both deceased, so that would be one part , once we work out that side then we have to concantenate the name to include "&" as necessary for a mail merge.

    I always come here when stuck and hopefully someone can just look at and go EASY fella this is the best method for that.

    Dont want to over complicate with nested If statements if possible want it to be simple enough for someone else to read the formulas so can be broken down in to steps if need be.

    So really how I see it (could be wrong) We have a formula that compares the name against the date of death .. if alive copy their name to another cell , if deceased leave blank..... then a formula that works out If person 1 deceased then person 2 becomes main contact and not include and ampersand ,if both deceased flag it as a terminated contract.

    Hopefully that makes sense... if you have any questions let me know.

    Would be much appreciated. There are other factors I have to take in to account but this is the one that has me a bit puzzled as my formula skills are patchy Ive realised.


    many thanks

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: If formula with many different outcomes and also to combine names for a mail merge

    Attach a sample workbook.

    When you are in Advanced reply, click on the paperclip to open the upload window.

    View Pic
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    09-26-2012
    Location
    Hackney
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: If formula with many different outcomes and also to combine names for a mail merge

    Hi ,

    Appreciate any input I have pulled a sample in to a fresh spreadsheet .... links back to the Main register so have pasted the actual formula in the top 3 rows and pasted the values in a couple of rows down in case you just get #REF# instead of the data....

    Columns V onwards is just me playing around.... my thinking in simple terms is ....breaking it down before combining ... compare names to date of death , then have a column with and & if there is more than one vendor after deceased party is removed (ie both alive) ... hopefully Im making sense... sounded simple when I though of it but just have a brain fart on best way of doing it !! thanks

    Sample Insurance Register.xls

  4. #4
    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,945

    Re: If formula with many different outcomes and also to combine names for a mail merge

    Hi akoli and welcome to the forum

    based on your comment that you dont want a bunch of nested if's, probably your best is to have (like you were thinking) and few helper columns, because what you are after is based on a whole series of "if this, then that, else that"

    I'm trying to make sense of what you want, based on the file you uploaded, and not having much luck (eg, i cant find any vendor1 or 2 in columns A and B?)

    perhaps if you could include a few samples of what your expected outcome is, along with how you arrived at that?
    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

  5. #5
    Registered User
    Join Date
    09-26-2012
    Location
    Hackney
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: If formula with many different outcomes and also to combine names for a mail merge

    Sorry the whole thing is a mess and I dont have the time to fix the main database as too much of a knock on effect for the other queries and reports that various people pull from it. Database was setup with a company of 3 people there are now 25 working from it !!!

    I have a query in access that filters out the relevant data across a couple of tables and filters out files that are current , this also concantenates the vendors from vendor 1 and vendor 2 to Person1Full Person2Full so the excel sheet pulls that query and I have a seperate sheet with extra columns and formulas to do the rest of the magic ;

    Spreadsheet should be .... Lead Number Column A , Person1Full Column B & Person2Full Column C , date of death vendor 1 column V , Date of death Vendor 2 column W.

    So helper columns are the way to go then... I've got some time today so will put in some more thinking time and see what I come up with ... thanks

    Edit - had a play around thre in some helper columns and it seems to work up to a point ... row 5 is picking up a zero where it should be blank (I have option ticked to not show blanks in options)

    Does this formula seem ok or is there a simpler way to do things... (only have to worry about formulas in columns W , X & Y)

    Many thanks.

    Sample sheet 2.xls
    Last edited by akoli; 01-14-2013 at 09:45 PM.

  6. #6
    Registered User
    Join Date
    09-26-2012
    Location
    Hackney
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: If formula with many different outcomes and also to combine names for a mail merge

    Almost there but something still has me confused IF statement returning the wrong value is my syntax out or ;

    =IF(C1="U","",C1)- if it equals U then replace with blank - but it returns result as false when it should be true.
    but if I do this ;



    =IF(AND(C1>"T",C1<"V"),"",C1) this returns the correct result but does the same job as formula above does it not.

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: If formula with many different outcomes and also to combine names for a mail merge

    your value in c3 has a space after it try
    =IF(TRIM(C3)="U","",TRIM(C3))

+ 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