Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Duplicate value with blank space

Hi,

Can anyone pls help me to solve the below
question?

I've 2 columns typed with the respective header:Ref No(Column C) and
Amount ( Column H).
I 'd like to check whether Ref No in column C corresponding with the
amount in column H are duplicate in these columns. If there is
duplicate then highlight the cell with colors.
The COUNTIF function is working fine for the above situation but it
fails to detect the following values, particularly with blank space in
between the value in Ref No column although they are considered the
same number or duplicate :-

Ref No Amount
A BOT 987415 $250.00
B BOT987415 $250.00
C BOT 987415 $250.00

Is there anyway that can help to solve the above either excel VBA or
excel function? ( ie to give the same solution as COUNTIF function )

Thanks in advance.
Rgds
Lenard,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default Duplicate value with blank space

If you can do it, insert a column (could be hidden) and
eliminate the spaces in the Ref No and concatenate with
the amount. To eliminate the spaces, use the substitue
function. If the first BOT entry is in cell B2 and the
first amount in C2, in D2 enter =substitute(B2," ","")
&C2. In effect you've made a unique key Excel can now
check against. Now use that unique key in a conditional
formatting to highlight those instances where they are the
same.

-----Original Message-----
Hi,

Can anyone pls help me to solve the below
question?

I've 2 columns typed with the respective header:Ref No

(Column C) and
Amount ( Column H).
I 'd like to check whether Ref No in column C

corresponding with the
amount in column H are duplicate in these columns. If

there is
duplicate then highlight the cell with colors.
The COUNTIF function is working fine for the above

situation but it
fails to detect the following values, particularly with

blank space in
between the value in Ref No column although they are

considered the
same number or duplicate :-

Ref No Amount
A BOT 987415 $250.00
B BOT987415 $250.00
C BOT 987415 $250.00

Is there anyway that can help to solve the above either

excel VBA or
excel function? ( ie to give the same solution as COUNTIF

function )

Thanks in advance.
Rgds
Lenard,
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Duplicate value with blank space

"Mike" wrote in message ...
If you can do it, insert a column (could be hidden) and
eliminate the spaces in the Ref No and concatenate with
the amount. To eliminate the spaces, use the substitue
function. If the first BOT entry is in cell B2 and the
first amount in C2, in D2 enter =substitute(B2," ","")
&C2. In effect you've made a unique key Excel can now
check against. Now use that unique key in a conditional
formatting to highlight those instances where they are the
same.

-----Original Message-----
Hi,

Can anyone pls help me to solve the below
question?

I've 2 columns typed with the respective header:Ref No

(Column C) and
Amount ( Column H).
I 'd like to check whether Ref No in column C

corresponding with the
amount in column H are duplicate in these columns. If

there is
duplicate then highlight the cell with colors.
The COUNTIF function is working fine for the above

situation but it
fails to detect the following values, particularly with

blank space in
between the value in Ref No column although they are

considered the
same number or duplicate :-

Ref No Amount
A BOT 987415 $250.00
B BOT987415 $250.00
C BOT 987415 $250.00

Is there anyway that can help to solve the above either

excel VBA or
excel function? ( ie to give the same solution as COUNTIF

function )

Thanks in advance.
Rgds
Lenard,
.


Hi Mike,

Thanks, it solves the question

Regards
Lenard
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Duplicate value with blank space

(ltong) wrote in message . com...
"Mike" wrote in message ...
If you can do it, insert a column (could be hidden) and
eliminate the spaces in the Ref No and concatenate with
the amount. To eliminate the spaces, use the substitue
function. If the first BOT entry is in cell B2 and the
first amount in C2, in D2 enter =substitute(B2," ","")
&C2. In effect you've made a unique key Excel can now
check against. Now use that unique key in a conditional
formatting to highlight those instances where they are the
same.

-----Original Message-----
Hi,

Can anyone pls help me to solve the below
question?

I've 2 columns typed with the respective header:Ref No

(Column C) and
Amount ( Column H).
I 'd like to check whether Ref No in column C

corresponding with the
amount in column H are duplicate in these columns. If

there is
duplicate then highlight the cell with colors.
The COUNTIF function is working fine for the above

situation but it
fails to detect the following values, particularly with

blank space in
between the value in Ref No column although they are

considered the
same number or duplicate :-

Ref No Amount
A BOT 987415 $250.00
B BOT987415 $250.00
C BOT 987415 $250.00

Is there anyway that can help to solve the above either

excel VBA or
excel function? ( ie to give the same solution as COUNTIF

function )

Thanks in advance.
Rgds
Lenard,
.


Hi Mike,

Thanks, it solves the question

Regards
Lenard



Hi,

I've another questions as follows : -

A)Is there anyway to remove "( )", "[ ]" or "{ }" from the numbering
in a cell ?, ie the result will be I0307981PS,I04L04513,I0220105S for
the following examples

It seems that SUBSTITUTE function fails to solve this question, ie
=SUBSTITUTE(A2,"()","")

E.g.

1) I03-07981(P-S)
2) I04-[L]04513
3) I02-201{05}S

B) How to extract a numbering as I030214PPG without the quotation
marks from I-03-02 14*(P-PG) ? Can SUBSTITUTE function solve this
question as well ?

Please helps

Thanks
Regards
Lenard
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Duplicate value with blank space

(ltong) wrote in message . com...
"Mike" wrote in message ...
If you can do it, insert a column (could be hidden) and
eliminate the spaces in the Ref No and concatenate with
the amount. To eliminate the spaces, use the substitue
function. If the first BOT entry is in cell B2 and the
first amount in C2, in D2 enter =substitute(B2," ","")
&C2. In effect you've made a unique key Excel can now
check against. Now use that unique key in a conditional
formatting to highlight those instances where they are the
same.

-----Original Message-----
Hi,

Can anyone pls help me to solve the below
question?

I've 2 columns typed with the respective header:Ref No

(Column C) and
Amount ( Column H).
I 'd like to check whether Ref No in column C

corresponding with the
amount in column H are duplicate in these columns. If

there is
duplicate then highlight the cell with colors.
The COUNTIF function is working fine for the above

situation but it
fails to detect the following values, particularly with

blank space in
between the value in Ref No column although they are

considered the
same number or duplicate :-

Ref No Amount
A BOT 987415 $250.00
B BOT987415 $250.00
C BOT 987415 $250.00

Is there anyway that can help to solve the above either

excel VBA or
excel function? ( ie to give the same solution as COUNTIF

function )

Thanks in advance.
Rgds
Lenard,
.


Hi Mike,

Thanks, it solves the question

Regards
Lenard


Hi,

I've another questions as follows : -

A)Is there anyway to remove "( )", "[ ]" or "{ }" from the numbering
in a cell ?, ie the result will be I0307981PS,I04L04513,I0220105S for
the following examples

It seems that SUBSTITUTE function fails to solve this question, ie
=SUBSTITUTE(A2,"()","")

E.g.

1) I03-07981(P-S)
2) I04-[L]04513
3) I02-201{05}S

B) How to extract a numbering as I030214PPG without the quotation
marks from I-03-02 14*(P-PG) ? Can SUBSTITUTE function solve this
question as well ?

Please helps

Thanks
Regards
Lenard


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Duplicate value with blank space

You could nest a bunch of substitutes together like:

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"-",""),"[",""),"]","")
(but excel has a limit of 7 nested functions)

Maybe a macro would work better:

Option Explicit
Sub cleanEmUp()

Dim myBadChars As Variant
Dim iCtr As Long

myBadChars = Array("-", "[", "]", "{", "}", "(", ")")

For iCtr = LBound(myBadChars) To UBound(myBadChars)
Selection.Replace What:=myBadChars(iCtr), _
Replacement:="", _
LookAt:=xlPart, SearchOrder:=xlByRows, _
MatchCase:=False
Next iCtr

End Sub

Select your cells and run this macro.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

ltong wrote:

(ltong) wrote in message . com...
"Mike" wrote in message ...
If you can do it, insert a column (could be hidden) and
eliminate the spaces in the Ref No and concatenate with
the amount. To eliminate the spaces, use the substitue
function. If the first BOT entry is in cell B2 and the
first amount in C2, in D2 enter =substitute(B2," ","")
&C2. In effect you've made a unique key Excel can now
check against. Now use that unique key in a conditional
formatting to highlight those instances where they are the
same.

-----Original Message-----
Hi,

Can anyone pls help me to solve the below
question?

I've 2 columns typed with the respective header:Ref No

(Column C) and
Amount ( Column H).
I 'd like to check whether Ref No in column C

corresponding with the
amount in column H are duplicate in these columns. If

there is
duplicate then highlight the cell with colors.
The COUNTIF function is working fine for the above

situation but it
fails to detect the following values, particularly with

blank space in
between the value in Ref No column although they are

considered the
same number or duplicate :-

Ref No Amount
A BOT 987415 $250.00
B BOT987415 $250.00
C BOT 987415 $250.00

Is there anyway that can help to solve the above either

excel VBA or
excel function? ( ie to give the same solution as COUNTIF

function )

Thanks in advance.
Rgds
Lenard,
.


Hi Mike,

Thanks, it solves the question

Regards
Lenard


Hi,

I've another questions as follows : -

A)Is there anyway to remove "( )", "[ ]" or "{ }" from the numbering
in a cell ?, ie the result will be I0307981PS,I04L04513,I0220105S for
the following examples

It seems that SUBSTITUTE function fails to solve this question, ie
=SUBSTITUTE(A2,"()","")

E.g.

1) I03-07981(P-S)
2) I04-[L]04513
3) I02-201{05}S

B) How to extract a numbering as I030214PPG without the quotation
marks from I-03-02 14*(P-PG) ? Can SUBSTITUTE function solve this
question as well ?

Please helps

Thanks
Regards
Lenard


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Duplicate value with blank space

Add as many characters to that array as you need. I stopped after just a few.

Dave Peterson wrote:

You could nest a bunch of substitutes together like:

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"-",""),"[",""),"]","")
(but excel has a limit of 7 nested functions)

Maybe a macro would work better:

Option Explicit
Sub cleanEmUp()

Dim myBadChars As Variant
Dim iCtr As Long

myBadChars = Array("-", "[", "]", "{", "}", "(", ")")

For iCtr = LBound(myBadChars) To UBound(myBadChars)
Selection.Replace What:=myBadChars(iCtr), _
Replacement:="", _
LookAt:=xlPart, SearchOrder:=xlByRows, _
MatchCase:=False
Next iCtr

End Sub

Select your cells and run this macro.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

ltong wrote:

(ltong) wrote in message . com...
"Mike" wrote in message ...
If you can do it, insert a column (could be hidden) and
eliminate the spaces in the Ref No and concatenate with
the amount. To eliminate the spaces, use the substitue
function. If the first BOT entry is in cell B2 and the
first amount in C2, in D2 enter =substitute(B2," ","")
&C2. In effect you've made a unique key Excel can now
check against. Now use that unique key in a conditional
formatting to highlight those instances where they are the
same.

-----Original Message-----
Hi,

Can anyone pls help me to solve the below
question?

I've 2 columns typed with the respective header:Ref No
(Column C) and
Amount ( Column H).
I 'd like to check whether Ref No in column C
corresponding with the
amount in column H are duplicate in these columns. If
there is
duplicate then highlight the cell with colors.
The COUNTIF function is working fine for the above
situation but it
fails to detect the following values, particularly with
blank space in
between the value in Ref No column although they are
considered the
same number or duplicate :-

Ref No Amount
A BOT 987415 $250.00
B BOT987415 $250.00
C BOT 987415 $250.00

Is there anyway that can help to solve the above either
excel VBA or
excel function? ( ie to give the same solution as COUNTIF
function )

Thanks in advance.
Rgds
Lenard,
.


Hi Mike,

Thanks, it solves the question

Regards
Lenard


Hi,

I've another questions as follows : -

A)Is there anyway to remove "( )", "[ ]" or "{ }" from the numbering
in a cell ?, ie the result will be I0307981PS,I04L04513,I0220105S for
the following examples

It seems that SUBSTITUTE function fails to solve this question, ie
=SUBSTITUTE(A2,"()","")

E.g.

1) I03-07981(P-S)
2) I04-[L]04513
3) I02-201{05}S

B) How to extract a numbering as I030214PPG without the quotation
marks from I-03-02 14*(P-PG) ? Can SUBSTITUTE function solve this
question as well ?

Please helps

Thanks
Regards
Lenard


--

Dave Peterson


--

Dave Peterson

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
Blank space Dinesh Excel Worksheet Functions 5 March 2nd 10 07:54 PM
How many way to represent the blank space? Eric Excel Discussion (Misc queries) 7 April 26th 09 06:47 PM
add blank space in cell if first name is not blank stef Excel Worksheet Functions 6 August 23rd 06 02:26 AM
BLANK SPACE TO A NUMBER kevin Excel Worksheet Functions 3 December 30th 05 06:10 PM
I want a blank space on a worksheet when the question is blank? Patrizia Excel Discussion (Misc queries) 2 June 23rd 05 12:51 AM


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

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"