View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Carlo Carlo is offline
external usenet poster
 
Posts: 179
Default Detect double digit

Hi Shamsulz

it depends on how you want to mark your digits, but you can decide that for
yourself.

i would do something like this:

if right(YourDigit,1) = left(right(YourDigit,2),1) then
'Do Something
end if

and YourDigit would be a variable or even a cell.

if you don't like VBA you could do it like this as a cell-formula

if(right(A1,1) = left(right(A1,2),1);"Double Digit detected"; "")

hth

Cheers Carlo

"ShamsulZ" wrote:

I'm looking for a formula that enable me to detect any no. of last 2 digit
that is the same for e.g 1233, abcd2345677, 90566 etc. Thanks for your help