Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default How do I compare the stored data in micro

Hi,

I got four columns of stored list of addresses and dates (two for address
and two for dates) which I want to match against each other. The formats of
those columns are in example below

Column A
10 V Street

Colum B
12/16/2009

Column C
12 DEC:PTD:DEC 2009

Column D
10 V Street

I want column A and D matched as is and the column Bs first two digits (12)
and last four digits (2009) should be matched with column Cs first two
digits (12) and the last four digits (2009). If they are not the same it
should appear differently (may be red text). Any help on this will greatly
appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default How do I compare the stored data in micro

hi
formulas return values to the cell in which they reside. they cannot perform
actions like change font colors.
this formula should work or at least it work on your example.

=IF(AND(A2=D2,MONTH(B2)=VALUE(LEFT(C2,2)),YEAR(B2) =VALUE(RIGHT(C2,4))),"matched", "no match")

careful. it wrapped.
you can use conditional formatting on the cell (E column?) to change the
color if Matched or another color if No Match.

regards
FSt1


"Help on formula" wrote:

Hi,

I got four columns of stored list of addresses and dates (two for address
and two for dates) which I want to match against each other. The formats of
those columns are in example below

Column A
10 V Street

Colum B
12/16/2009

Column C
12 DEC:PTD:DEC 2009

Column D
10 V Street

I want column A and D matched as is and the column Bs first two digits (12)
and last four digits (2009) should be matched with column Cs first two
digits (12) and the last four digits (2009). If they are not the same it
should appear differently (may be red text). Any help on this will greatly
appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default How do I compare the stored data in micro

hi
sorry. you mentioned macro in the subject but my slow brain keyed on your
long on name "help with formula".
Sub matchnomath()
Dim fc As String
Dim sc As String
Dim tc As String
Dim fcl As String
fc = Range("A2").Value
sc = Range("B2").Value
tc = Range("C2").Value
fcl = Range("D2").Value
If fc = fcl And _
Left(sc, 2) = Left(tc, 2) And _
Right(sc, 4) = Right(tc, 4) Then
MsgBox "Matched"
Range("A2").Resize(1, 4).Font.ColorIndex = 3 'red
Else
MsgBox "no match"
End If
End Sub

regards
FSt1

"FSt1" wrote:

hi
formulas return values to the cell in which they reside. they cannot perform
actions like change font colors.
this formula should work or at least it work on your example.

=IF(AND(A2=D2,MONTH(B2)=VALUE(LEFT(C2,2)),YEAR(B2) =VALUE(RIGHT(C2,4))),"matched", "no match")

careful. it wrapped.
you can use conditional formatting on the cell (E column?) to change the
color if Matched or another color if No Match.

regards
FSt1


"Help on formula" wrote:

Hi,

I got four columns of stored list of addresses and dates (two for address
and two for dates) which I want to match against each other. The formats of
those columns are in example below

Column A
10 V Street

Colum B
12/16/2009

Column C
12 DEC:PTD:DEC 2009

Column D
10 V Street

I want column A and D matched as is and the column Bs first two digits (12)
and last four digits (2009) should be matched with column Cs first two
digits (12) and the last four digits (2009). If they are not the same it
should appear differently (may be red text). Any help on this will greatly
appreciated.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default How do I compare the stored data in micro

Thank so much. It turns the text red only to the second row, although it's
matching.


hi
sorry. you mentioned macro in the subject but my slow brain keyed on your
long on name "help with formula".
Sub matchnomath()
Dim fc As String
Dim sc As String
Dim tc As String
Dim fcl As String
fc = Range("A2").Value
sc = Range("B2").Value
tc = Range("C2").Value
fcl = Range("D2").Value
If fc = fcl And _
Left(sc, 2) = Left(tc, 2) And _
Right(sc, 4) = Right(tc, 4) Then
MsgBox "Matched"
Range("A2").Resize(1, 4).Font.ColorIndex = 3 'red
Else
MsgBox "no match"
End If
End Sub

regards
FSt1

"FSt1" wrote:

hi
formulas return values to the cell in which they reside. they cannot perform
actions like change font colors.
this formula should work or at least it work on your example.

=IF(AND(A2=D2,MONTH(B2)=VALUE(LEFT(C2,2)),YEAR(B2) =VALUE(RIGHT(C2,4))),"matched", "no match")

careful. it wrapped.
you can use conditional formatting on the cell (E column?) to change the
color if Matched or another color if No Match.

regards
FSt1


"Help on formula" wrote:

Hi,

I got four columns of stored list of addresses and dates (two for address
and two for dates) which I want to match against each other. The formats of
those columns are in example below

Column A
10 V Street

Colum B
12/16/2009

Column C
12 DEC:PTD:DEC 2009

Column D
10 V Street

I want column A and D matched as is and the column Bs first two digits (12)
and last four digits (2009) should be matched with column Cs first two
digits (12) and the last four digits (2009). If they are not the same it
should appear differently (may be red text). Any help on this will greatly
appreciated.

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
Sum data with criteria stored in row and column vivi Excel Worksheet Functions 3 October 16th 08 04:32 AM
Data return from SQL Stored procedure... Jonathon Shull Excel Discussion (Misc queries) 0 July 29th 08 04:25 PM
Explain how data is stored in excel in your own fahad Excel Discussion (Misc queries) 1 April 21st 08 01:10 PM
VLOOKUP should compare numbers stored as text to plain numbers. VLOOKUP - Numbers stored as text Excel Worksheet Functions 0 March 31st 06 05:53 PM
Extract data from Stored procedure anu_manu Excel Discussion (Misc queries) 0 February 15th 06 02:49 PM


All times are GMT +1. The time now is 08:52 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"