code to look for a certain character?

bdunk

Active Member
Joined
Aug 1, 2002
Messages
290
Hello all, I was wondering how I would write a function that would look in a cell for specified character and then put a value in another column whether it found it or not. Example:

I have list of email addresses in column D. I would like a '1' put in column E if a "@" is found in column D.

THanks


Bdunk
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Oaktree

MrExcel MVP
Joined
Jun 20, 2002
Messages
8,066
Office Version
  1. 365
To go one by one (e.g. E2 checks ony if D2 has an "@"), try =--ISNUMBER(SEARCH("@",D2)) and copy down.

To have E2 check if there is a "@" *anywhere* in column D, try = --ISNUMBER(MATCH("*@*,D:D,0))
 

lozzablake

Well-known Member
Joined
Dec 15, 2005
Messages
818
Can't you just use the FIND function?

eg in E1 put =IF(ISERROR(FIND("@",D1,1)),"",1)
 

Forum statistics

Threads
1,176,410
Messages
5,902,931
Members
435,002
Latest member
chenmoti

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
Top