+ Reply to Thread
Results 1 to 6 of 6

Forumla for Multiple Text Conditions to Return Certain Conditional Values?

  1. #1
    Registered User
    Join Date
    03-01-2011
    Location
    Sf, CA
    MS-Off Ver
    EXCEL for MAC OS on Imac
    Posts
    3

    Cool Forumla for Multiple Text Conditions to Return Certain Conditional Values?

    I have a database list over 10,000 contacts that is organized by First Name, Last Name, Email Address and Company.

    The last fields I need to sort and fill in are the Company field. Is there a formula I can use that can search the whole email column for multiple phrases like "@yahoo", or "@aig.com", or "@investmentfirm.com"? And then have it return a value in the company field that would show Yahoo, AIG, Investment Firm (respectively)? and if it there is an email that I haven't added in the conditional formula like "@fkdsjflkds.com" it just returns a blank response in the company field? PLEASE HELP!!!!!!!!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Forumla for Multiple Text Conditions to Return Certain Conditional Values?

    Try:

    Please Login or Register  to view this content.
    where C2 contains first email to review.

    copied down
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    03-01-2011
    Location
    Sf, CA
    MS-Off Ver
    EXCEL for MAC OS on Imac
    Posts
    3

    Re: Forumla for Multiple Text Conditions to Return Certain Conditional Values?

    When you say...
    Quote Originally Posted by NBVC View Post

    Please Login or Register  to view this content.
    what is the "z" referring to? I'm trying to tweak it because just using that code doesn't return anything. What about the Lookup value of "9.999E+307?" Did you mean to include that?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Forumla for Multiple Text Conditions to Return Certain Conditional Values?

    see attached to see the formula does work as you explained you wanted the results to appear.


    This part: LOOKUP(REPT("z",255),CHOOSE({1,2},""

    is an error check.. and simply returns a blank if a match is not met as determined by the next part of the formula:

    LOOKUP(9.99999E+307,SEARCH({"@aig","@yahoo","@investmentfirm.com"},C2),{"AIG","Yahoo","Investment Firm"}))

    the 9.9999E+307 is referred to as a Big Number (the biggest Excel can work with)... Lookup looks for the last value in a specified range that is smaller than or equal to the lookup value... so it is looking for the Big Number and obviously can't find it so it will return the last number in the range.

    The range, in this case is the resulting array from SEARCH({"@aig","@yahoo","@investmentfirm.com"},C2)

    each part within the { } brackets is searched for within cell C2. If each value is found, it returns a number specifying the positon within C2 that the match starts... the other searches will yield errors since they won't be found.... so then Lookup() finds that number that is returned and then returns the item in the result_vector corresponding to where that number was found in the Lookup() function.

    Hope that helps.
    Attached Files Attached Files
    Last edited by NBVC; 03-01-2011 at 06:13 PM.

  5. #5
    Registered User
    Join Date
    03-01-2011
    Location
    Sf, CA
    MS-Off Ver
    EXCEL for MAC OS on Imac
    Posts
    3

    Re: Forumla for Multiple Text Conditions to Return Certain Conditional Values?

    Thank you so much for your help! There are way too many different email extensions I'm realizing. The list is over 10,000 contacts, so that would take very long to go through and assign a value for each differing email extention.

    Thanks anyways, It did work the formula you suggested so thank u!

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Forumla for Multiple Text Conditions to Return Certain Conditional Values?

    You can always create a table of values on the side somewhere with one column listing all the various @addresses.. and in the next column their respective companies you want returned, then you can update the previous formula to something like:

    =LOOKUP(REPT("z",255),CHOOSE({1,2},"",LOOKUP(9.99999E+307,SEARCH($X$2:$X$100,C2),$Y$2:$Y$100})))

    where X2:Y100 contains the table of values... you can expand the table as desired.

    Or you can extract the part with between the @ and the . and use that in the company column as is...

    =MID(C2,FIND("@",C2)+1,FIND(".",C2,FIND("@",C2))-FIND("@",C2)-1)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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