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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Try listing all the specific texts somewhere on the worksheet, e.g. K2:K100 so that in K2 you put @gmail.com and in K3 @yahoo etc. [you might need to use a preceding apostrophe with that data, e.g. type in '@gmail.com]

Now you can use this formula

=A1&IF(SUMPRODUCT(ISNUMBER(SEARCH(K$2:K$100,A1))*(K$2:K$100<>"")),"@members","")
 
Upvote 0

Forum statistics

Threads
1,224,545
Messages
6,179,432
Members
452,915
Latest member
hannnahheileen

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