Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Detect double digit

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Detect double digit

Are you looking for its position in the string? This gives the first
position of the first pair in the string

=MIN(IF(MID(A1,ROW(INDIRECT("1:"&LEN(A1)-1)),1)=MID(A1,ROW(INDIRECT("2:"&LEN
(A1))),1),ROW(INDIRECT("1:"&LEN(A1)-1))))

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"ShamsulZ" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,886
Default Detect double digit

Hi

Try
=IF(LEN(A1)<2,"",MID(A1,LEN(A1)-1,1)=RIGHT(A1))

--
Regards

Roger Govier


"ShamsulZ" wrote in message
...
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



  #4   Report Post  
Posted to microsoft.public.excel.programming
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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Detect double digit

=MOD(RIGHT(A1,2), 11) = 0

"ShamsulZ" wrote in message
...
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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,886
Default Detect double digit

Very neat, David!!!

--
Regards

Roger Govier


"David F Cox" wrote in message
...
=MOD(RIGHT(A1,2), 11) = 0

"ShamsulZ" wrote in message
...
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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
add a double digit number together adding double digit numbers Excel Discussion (Misc queries) 14 December 7th 08 07:02 PM
recognizing double digit numbers in code DB Excel Discussion (Misc queries) 3 March 2nd 07 04:43 PM
Cells() produces reversed date format for double digit dates tarns[_10_] Excel Programming 5 April 6th 06 02:08 AM
Return double digit month quartz[_2_] Excel Programming 2 April 4th 05 04:09 PM
When we enter a 16 digit number (credit card) the last digit chan. ceking Excel Discussion (Misc queries) 5 December 8th 04 11:45 PM


All times are GMT +1. The time now is 01:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"