Shorten long formula

YasserKhalil

Well-known Member
Joined
Jun 24, 2010
Messages
852
I have this formula that search for specific texts within range a1 and if there is any text of them will add "@members"..if not a1 will be as it is

here's the formula

Code:
=IF(OR(ISNUMBER(SEARCH("@gmail.com";A1));ISNUMBER(SEARCH("@yahoo";A1));ISNUMBER(SEARCH("@hotmail.co";A1));ISNUMBER(SEARCH("@myrlfh.com";A1));ISNUMBER(SEARCH("@live.com";A1));ISNUMBER(SEARCH("@ihug.co.nz";A1));ISNUMBER(SEARCH("@aol.com";A1));ISNUMBER(SEARCH("@talktalk.net";A1));ISNUMBER(SEARCH("@odonnellandmellon.com";A1));ISNUMBER(SEARCH("@blueyonder.co";A1));ISNUMBER(SEARCH("@gv.net";A1));ISNUMBER(SEARCH("@optonline.net";A1));ISNUMBER(SEARCH("@abv.bg";A1));ISNUMBER(SEARCH("@comcast.net";A1));ISNUMBER(SEARCH("@googlemail.com";A1));ISNUMBER(SEARCH("@btinternet.com";A1));ISNUMBER(SEARCH("@amjt.karoo.co";A1));ISNUMBER(SEARCH("@sky.com";A1));ISNUMBER(SEARCH("@deviangroup.com";A1));ISNUMBER(SEARCH("@publicclass.com";A1));ISNUMBER(SEARCH("@T-Online.de";A1));ISNUMBER(SEARCH("@cox.net";A1));ISNUMBER(SEARCH("@vtxnet.ch";A1));ISNUMBER(SEARCH("@live.fr";A1));ISNUMBER(SEARCH("@fcu.edu.tw";A1));ISNUMBER(SEARCH("@sbcglobal.net";A1));ISNUMBER(SEARCH("@terra.es";A1));ISNUMBER(SEARCH("@excite.com";A1));ISNUMBER(SEARCH("@CoB";A1));ISNUMBER(SEARCH("@msn.com";A1));ISNUMBER(SEARCH("@Rubesick";A1));ISNUMBER(SEARCH("@yahoo.no";A1));ISNUMBER(SEARCH("@email.com";A1));ISNUMBER(SEARCH("@netzero.com";A1));ISNUMBER(SEARCH("@aim.com";A1));ISNUMBER(SEARCH("@verizon.net";A1));ISNUMBER(SEARCH("@welchol";A1));ISNUMBER(SEARCH("@feuerwehr-kettig.de";A1));ISNUMBER(SEARCH("@pacbell.net";A1));ISNUMBER(SEARCH("@odu.edu";A1));ISNUMBER(SEARCH("@gmx.de";A1));ISNUMBER(SEARCH("@bespoke-ni.com";A1));ISNUMBER(SEARCH("@du.ch";A1));ISNUMBER(SEARCH("@hotm";A1));ISNUMBER(SEARCH("@juno.com";A1));ISNUMBER(SEARCH("@rrel";A1));ISNUMBER(SEARCH("@webtv.net";A1));ISNUMBER(SEARCH("@cybernet.ch";A1));ISNUMBER(SEARCH("@goodthinxx.com";A1));ISNUMBER(SEARCH("@tiscalinet.ch";A1));ISNUMBER(SEARCH("@charter.net";A1));ISNUMBER(SEARCH("@web.de";A1));ISNUMBER(SEARCH("@ukonline.co";A1));ISNUMBER(SEARCH("@pandora.";A1));ISNUMBER(SEARCH("@hawaii";A1));ISNUMBER(SEARCH("@earthlink";A1));ISNUMBER(SEARCH("@lumenart.de";A1));ISNUMBER(SEARCH("@gmx.net";A1));ISNUMBER(SEARCH("@tc.umn";A1));ISNUMBER(SEARCH("@telia.com";A1));ISNUMBER(SEARCH("@tampabay";A1));ISNUMBER(SEARCH("@master.karoo";A1));ISNUMBER(SEARCH("@ormus.ws";A1));ISNUMBER(SEARCH("@http.com";A1));ISNUMBER(SEARCH("@ehE2Y";A1));ISNUMBER(SEARCH("@rbn";A1));ISNUMBER(SEARCH("@ukr.net";A1));ISNUMBER(SEARCH("@id ";A1));ISNUMBER(SEARCH("@aon.at";A1));ISNUMBER(SEARCH("@cWmz5";A1));ISNUMBER(SEARCH("@cachondo.";A1));ISNUMBER(SEARCH("@sasktel.";A1));ISNUMBER(SEARCH("@tic ";A1));ISNUMBER(SEARCH("@hoteldecebal";A1));ISNUMBER(SEARCH("@nkliker";A1));ISNUMBER(SEARCH("@ley15136";A1));ISNUMBER(SEARCH("@deone1";A1));ISNUMBER(SEARCH("@l ";A1));ISNUMBER(SEARCH("@yahoo.co";A1));ISNUMBER(SEARCH("@yahoo.co";A1));ISNUMBER(SEARCH("@yahoo.co";A1));ISNUMBER(SEARCH("@yahoo.co";A1));ISNUMBER(SEARCH("@yahoo.co";A1)));A1&"@members";A1)
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Are you looking for specific domains to appear in the email address to append "@members" or do you want to append "@members" to any email address that is present?
 
Upvote 0
Hi maybe try:

=IF(ISERROR(LEFT(A1,FIND("@",A1)-1)&"@members"),A1,(LEFT(A1,FIND("@",A1)-1)&"@members"))
 
Last edited:
Upvote 0
If the presence of @ denotes an email address then try this formula

=A1&IF(COUNTIF(A1,"*@*"),"@members","")
 
Upvote 0
Try this:
=IF(ISERROR(SEARCH("@",A1,1)),A1,A1&"@members")

This function searches for "@" to appear in the string. If it appears, it appends "@members", otherwise it doesn't.
 
Upvote 0

Forum statistics

Threads
1,224,537
Messages
6,179,405
Members
452,911
Latest member
a_barila

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top