Archive

Posts Tagged ‘string’

Count Text in a Range

April 24th, 2009 No comments

Counting text in a range is easy. For example, if you would like count how many times “text” is in a specified range (named data), you can write something like this:
=COUNTIF(data,"*text*")

This formula will give you the count of all the cells where Excel found “text” at any place.

But let’s say you want to count wildcard characters in a range, then you can write something like this:
=SUM(IF(NOT(ISERR(FIND("*",data))),1,0))

This formula should be entered as an array formula with Ctrl + Shift + Enter. Usually, wildcard can be “escaped” using a tilde (~), but the FIND function doesn’t understand wildcard characters like the SEARCH function does.

Excel Function to check if text is palindrome or not

February 10th, 2005 No comments

Definition of palindrome as given in Answers.com

pal?in?drome (p?l’?n-dr?m’)

n.

A word, phrase, verse, or sentence that reads the same backward or forward. For example: A man, a plan, a canal, Panama!

Function IsPalindrome(sInput As String) As Boolean
If sInput = StrReverse(sInput) Then
IsPalindrome = True
Else
IsPalindrome = False
End If
End Function

Categories: String Operations Tags: , ,