IF a1 CONTAINS 2 ".", then A1, otherwise ""

jeremypyle

Board Regular
Joined
May 30, 2011
Messages
174
I want a code for if contains that asks for two of the same thing.

For example in b1, I want to say, "IF a1 CONTAINS two references to the character ".", then a1, otherwise ""

For example, if there was

jeremy.com in a1

It doesn't have 2 lots of "." so b1 would be empty

but if www.jeremy.com does have two lots of "."

Can someone please help me with this?
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
You will be counting the instance of text in a cell

Assuming G9 contains the text..

enter this formula in any cell..

Code:
=IF(SUM(LEN(G9)-LEN(SUBSTITUTE(G9,".","")))/LEN(".")>1,"more than 1", "")

The code will show "more than 1" if it has 2 or more dots ".".. Hope this helps.

:) cheers!

src:http://support.microsoft.com/kb/187667

-e.rgabrieldoronila
 
Upvote 0
Give this formula a try...

=IF(LEN(A1)-LEN(SUBSTITUTE(A1,".",""))=2,A1,"")
 
Upvote 0
Thanks for that Mike. I still haven't been able to figure out the problem from yesterday though. If you have a chance, would you mind checking the post I did yesterday?
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,822
Members
449,470
Latest member
Subhash Chand

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