View Single Post
  #2   Report Post  
ScottO
 
Posts: n/a
Default

It shouldn't be too hard to construct the "test formula", but I think that
the starting point is to identify what the tests are going to be.

I've got a few to propose:
1. Test that it's a text string
2. Test for the position of "@" in the text string (A)
3. Test for the position of "." in the text string (B)
4. Test that neither A or B are NA#
5. Test that there is text before A
6. Test that there is text between A and B
7. Test that there is text after B

There's probably some others that I haven't thought of (and maybe some of
mine are redundant).
Given the number of tests, it's probably worthwhile making one formula for
each test and then getting the answer with a summary formula.

Assuming the eddress is in A1, and the formulas go in cells B1, C1, etc.,
the try these:
1. B1 =IsText(A1)
2. C1 =Find("@",A1)
3. D1 =Find(".",A1)
4. E1 =SUM(C1:D1)
5. F1 =C11
6. G1 =D1-C11
7. H1 =Len(A1)D1

The summary formula (in I1) could then be something like =AND(B1:H1), where
a result of False means that at least one of the tests has failed.

It's a bit long winded, and may need some de-bugging, but it should get the
job done.
Rgds,
ScottO


"BethP" wrote in message
...
| Is there an easy formula to tell you if an email address is formatted
| correctly, with ? I don't even need to know more than that
| (such as valid domains, etc.) for now.
|
| My original thought was just a basic IF statement to drop in to the next
| column that tells me if the cell is formatted correctly. But I don't know
| how to look for text in a particular sequence or format.
|
| Any ideas for something like this, or better? Thanks!
| (You all always have the best answers!)
|
| -bethp
|
| (Inadvertently x-posted to Excel Programming too; sorry for the dupe
request!)