Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Tom Tom is offline
external usenet poster
 
Posts: 19
Default Record the date after matching the names

Hi,

My namelist.xls contains 10 stock codes for example - ABC, DEF, ....., XYZ
in the first column. How can I match these names against the closing
pricelist, 20060912.csv which contains the date and the closing prices, so
that if there is an exact match (not ABCD) it will record the corresponding
date (or otherwise a blank) in the second column of namelist.xls?

To make it clear, the date field is the second element of the closing
pricelist as shown below:

AAC,20061204,1.85,1.86,1.85,1.86,33383
AAE,20061204,.415,.48,.405,.445,294925
ABC,20061204,43,43,43,43,0
ABCD,20061204,.22,.22,.21,.21,96000
ACG,20061204,10.21,10.52,10.2,10.46,2920359
<snip........

Much appreciate for any help.


TIA
Tom

PS. For those who enjoy challenges, after that, close 20060912.csv and
incrementally open up the next pricelist, namely 20060913.csv and do the
match again, recording the date along the next, i.e. third column. Do that
for N = 1 to N = 10.


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default Record the date after matching the names

Say your name list is on Sheet1, A1 to A10, and you've pasted the csv to
Sheet2, from A1 down.

Try this *array* formula in B1 of Sheet1:

=INDEX(MID(Sheet2!A$1:A$5,FIND(",",Sheet2!A$1:A$5) +1,8),MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(",",Sheet2 !A$1:A$5)-1),0))

--
Array formulas must be entered with CSE, <Ctrl <Shift <Enter, instead of
the regular <Enter, which will *automatically* enclose the formula in curly
brackets, which *cannot* be done manually. Also, you must use CSE when
revising the formula.

*After* the CSE, copy down to A10.

If *no* match is found, you'll get a #N/A error returned.

If you really don't want to see the error message, and would prefer a blank
cell returned, the error trap makes this *array* formula "kind of bigger":

=IF(ISNA(MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(",",She et2!A$1:A$5)-1),0)),"",INDEX(MID(Sheet2!A$1:A$5,FIND(",",Sheet2 !A$1:A$5)+1,8),MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(" ,",Sheet2!A$1:A$5)-1),0)))

Don't forget the CSE for this one also!


--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"Tom" wrote in message
u...
Hi,

My namelist.xls contains 10 stock codes for example - ABC, DEF, ....., XYZ
in the first column. How can I match these names against the closing
pricelist, 20060912.csv which contains the date and the closing prices, so
that if there is an exact match (not ABCD) it will record the
corresponding
date (or otherwise a blank) in the second column of namelist.xls?

To make it clear, the date field is the second element of the closing
pricelist as shown below:

AAC,20061204,1.85,1.86,1.85,1.86,33383
AAE,20061204,.415,.48,.405,.445,294925
ABC,20061204,43,43,43,43,0
ABCD,20061204,.22,.22,.21,.21,96000
ACG,20061204,10.21,10.52,10.2,10.46,2920359
<snip........

Much appreciate for any help.


TIA
Tom

PS. For those who enjoy challenges, after that, close 20060912.csv and
incrementally open up the next pricelist, namely 20060913.csv and do the
match again, recording the date along the next, i.e. third column. Do that
for N = 1 to N = 10.


  #3   Report Post  
Posted to microsoft.public.excel.misc
Tom Tom is offline
external usenet poster
 
Posts: 19
Default Record the date after matching the names

I must thank you for your effort but unfortunately something was not right.
There was not a single match when there ought to be. What is this A$1:A$5?

Tom

"RagDyer" wrote in message
...
Say your name list is on Sheet1, A1 to A10, and you've pasted the csv to
Sheet2, from A1 down.

Try this *array* formula in B1 of Sheet1:

=INDEX(MID(Sheet2!A$1:A$5,FIND(",",Sheet2!A$1:A$5) +1,8),MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(",",Sheet2 !A$1:A$5)-1),0))

--
Array formulas must be entered with CSE, <Ctrl <Shift <Enter, instead
of
the regular <Enter, which will *automatically* enclose the formula in
curly
brackets, which *cannot* be done manually. Also, you must use CSE when
revising the formula.

*After* the CSE, copy down to A10.

If *no* match is found, you'll get a #N/A error returned.

If you really don't want to see the error message, and would prefer a
blank cell returned, the error trap makes this *array* formula "kind of
bigger":

=IF(ISNA(MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(",",She et2!A$1:A$5)-1),0)),"",INDEX(MID(Sheet2!A$1:A$5,FIND(",",Sheet2 !A$1:A$5)+1,8),MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(" ,",Sheet2!A$1:A$5)-1),0)))

Don't forget the CSE for this one also!


--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"Tom" wrote in message
u...
Hi,

My namelist.xls contains 10 stock codes for example - ABC, DEF, .....,
XYZ
in the first column. How can I match these names against the closing
pricelist, 20060912.csv which contains the date and the closing prices,
so
that if there is an exact match (not ABCD) it will record the
corresponding
date (or otherwise a blank) in the second column of namelist.xls?

To make it clear, the date field is the second element of the closing
pricelist as shown below:

AAC,20061204,1.85,1.86,1.85,1.86,33383
AAE,20061204,.415,.48,.405,.445,294925
ABC,20061204,43,43,43,43,0
ABCD,20061204,.22,.22,.21,.21,96000
ACG,20061204,10.21,10.52,10.2,10.46,2920359
<snip........

Much appreciate for any help.


TIA
Tom

PS. For those who enjoy challenges, after that, close 20060912.csv and
incrementally open up the next pricelist, namely 20060913.csv and do the
match again, recording the date along the next, i.e. third column. Do
that
for N = 1 to N = 10.




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default Record the date after matching the names

A$1:A$5 is the size of the range of names that you used in your OP.

It must be replaced with the *actual* cell references of your datalist (name
list).

I used it strictly as an example for you to try on your posted test data!

Since you didn't mention the size and location of your real data, I had to
use "something" to illustrate the workings of the suggested formula.

I might have (should have) mentioned to <<"adjust ranges to suit".
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Tom" wrote in message
...
I must thank you for your effort but unfortunately something was not right.
There was not a single match when there ought to be. What is this A$1:A$5?

Tom

"RagDyer" wrote in message
...
Say your name list is on Sheet1, A1 to A10, and you've pasted the csv to
Sheet2, from A1 down.

Try this *array* formula in B1 of Sheet1:

=INDEX(MID(Sheet2!A$1:A$5,FIND(",",Sheet2!A$1:A$5) +1,8),MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(",",Sheet2 !A$1:A$5)-1),0))

--
Array formulas must be entered with CSE, <Ctrl <Shift <Enter, instead
of
the regular <Enter, which will *automatically* enclose the formula in
curly
brackets, which *cannot* be done manually. Also, you must use CSE when
revising the formula.

*After* the CSE, copy down to A10.

If *no* match is found, you'll get a #N/A error returned.

If you really don't want to see the error message, and would prefer a
blank cell returned, the error trap makes this *array* formula "kind of
bigger":

=IF(ISNA(MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(",",She et2!A$1:A$5)-1),0)),"",INDEX(MID(Sheet2!A$1:A$5,FIND(",",Sheet2 !A$1:A$5)+1,8),MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(" ,",Sheet2!A$1:A$5)-1),0)))

Don't forget the CSE for this one also!


--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"Tom" wrote in message
u...
Hi,

My namelist.xls contains 10 stock codes for example - ABC, DEF, .....,
XYZ
in the first column. How can I match these names against the closing
pricelist, 20060912.csv which contains the date and the closing prices,
so
that if there is an exact match (not ABCD) it will record the
corresponding
date (or otherwise a blank) in the second column of namelist.xls?

To make it clear, the date field is the second element of the closing
pricelist as shown below:

AAC,20061204,1.85,1.86,1.85,1.86,33383
AAE,20061204,.415,.48,.405,.445,294925
ABC,20061204,43,43,43,43,0
ABCD,20061204,.22,.22,.21,.21,96000
ACG,20061204,10.21,10.52,10.2,10.46,2920359
<snip........

Much appreciate for any help.


TIA
Tom

PS. For those who enjoy challenges, after that, close 20060912.csv and
incrementally open up the next pricelist, namely 20060913.csv and do the
match again, recording the date along the next, i.e. third column. Do
that
for N = 1 to N = 10.





  #5   Report Post  
Posted to microsoft.public.excel.misc
Tom Tom is offline
external usenet poster
 
Posts: 19
Default Record the date after matching the names

That was a neat way of extracting the date (the second element). One last
question. What would I have to change in the formula in order to extract the
sixth element, a decimal number, which can range from 0.001 to 999.999?
Thanks again for your help RD.

Tom

"RagDyer" wrote in message
...
A$1:A$5 is the size of the range of names that you used in your OP.

It must be replaced with the *actual* cell references of your datalist
(name list).

I used it strictly as an example for you to try on your posted test data!

Since you didn't mention the size and location of your real data, I had to
use "something" to illustrate the workings of the suggested formula.

I might have (should have) mentioned to <<"adjust ranges to suit".
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Tom" wrote in message
...
I must thank you for your effort but unfortunately something was not
right. There was not a single match when there ought to be. What is this
A$1:A$5?

Tom

"RagDyer" wrote in message
...
Say your name list is on Sheet1, A1 to A10, and you've pasted the csv to
Sheet2, from A1 down.

Try this *array* formula in B1 of Sheet1:

=INDEX(MID(Sheet2!A$1:A$5,FIND(",",Sheet2!A$1:A$5) +1,8),MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(",",Sheet2 !A$1:A$5)-1),0))

--
Array formulas must be entered with CSE, <Ctrl <Shift <Enter,
instead of
the regular <Enter, which will *automatically* enclose the formula in
curly
brackets, which *cannot* be done manually. Also, you must use CSE when
revising the formula.

*After* the CSE, copy down to A10.

If *no* match is found, you'll get a #N/A error returned.

If you really don't want to see the error message, and would prefer a
blank cell returned, the error trap makes this *array* formula "kind of
bigger":

=IF(ISNA(MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(",",She et2!A$1:A$5)-1),0)),"",INDEX(MID(Sheet2!A$1:A$5,FIND(",",Sheet2 !A$1:A$5)+1,8),MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(" ,",Sheet2!A$1:A$5)-1),0)))

Don't forget the CSE for this one also!


--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit
!
---------------------------------------------------------------------------

"Tom" wrote in message
u...
Hi,

My namelist.xls contains 10 stock codes for example - ABC, DEF, .....,
XYZ
in the first column. How can I match these names against the closing
pricelist, 20060912.csv which contains the date and the closing prices,
so
that if there is an exact match (not ABCD) it will record the
corresponding
date (or otherwise a blank) in the second column of namelist.xls?

To make it clear, the date field is the second element of the closing
pricelist as shown below:

AAC,20061204,1.85,1.86,1.85,1.86,33383
AAE,20061204,.415,.48,.405,.445,294925
ABC,20061204,43,43,43,43,0
ABCD,20061204,.22,.22,.21,.21,96000
ACG,20061204,10.21,10.52,10.2,10.46,2920359
<snip........

Much appreciate for any help.


TIA
Tom

PS. For those who enjoy challenges, after that, close 20060912.csv and
incrementally open up the next pricelist, namely 20060913.csv and do
the
match again, recording the date along the next, i.e. third column. Do
that
for N = 1 to N = 10.









  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default Record the date after matching the names

Sorry for the delay, too much work ... not enough time to play in this sand
box!<bg

Also, no time to look for shorter options, but this works for me:

No error trap, returns text:
=INDEX(MID(Sheet2!A$1:A$5,FIND("^",SUBSTITUTE(Shee t2!A$1:A$5,",","^",5))+1,(FIND("^",SUBSTITUTE(Shee t2!A$1:A$5,",","^",6))-FIND("^",SUBSTITUTE(Sheet2!A$1:A$5,",","^",5)))-1),MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(",",Sheet2!A$ 1:A$5)-1),0))

For XL recognizable numbers, add double unary in front of Mid() function:
=INDEX(--MID(Sheet2!A$1:A$5,FIND("^",SUBSTITUTE(Sheet2!A$1: A$5,",","^",5))+1,(FIND("^",SUBSTITUTE(Sheet2!A$1: A$5,",","^",6))-FIND("^",SUBSTITUTE(Sheet2!A$1:A$5,",","^",5)))-1),MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(",",Sheet2!A$ 1:A$5)-1),0))

With error trap, returns text:
=IF(ISNA(MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(",",She et2!A$1:A$5)-1),0)),"",INDEX(MID(Sheet2!A$1:A$5,FIND("^",SUBSTI TUTE(Sheet2!A$1:A$5,",","^",5))+1,(FIND("^",SUBSTI TUTE(Sheet2!A$1:A$5,",","^",6))-FIND("^",SUBSTITUTE(Sheet2!A$1:A$5,",","^",5)))-1),MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(",",Sheet2!A$ 1:A$5)-1),0)))

Just add unary if you want numbers.

Don't forget, these are *array* formulas.
--
Array formulas are entered using CSE, <Ctrl <Shift <Enter, instead of the
regular <Enter, which will *automatically* enclose the formula in curly
brackets, which *cannot* be done manually. Also, CSE *must* be used when
revising the formula.

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"Tom" wrote in message
...
That was a neat way of extracting the date (the second element). One last
question. What would I have to change in the formula in order to extract the
sixth element, a decimal number, which can range from 0.001 to 999.999?
Thanks again for your help RD.

Tom

"RagDyer" wrote in message
...
A$1:A$5 is the size of the range of names that you used in your OP.

It must be replaced with the *actual* cell references of your datalist
(name list).

I used it strictly as an example for you to try on your posted test data!

Since you didn't mention the size and location of your real data, I had to
use "something" to illustrate the workings of the suggested formula.

I might have (should have) mentioned to <<"adjust ranges to suit".
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Tom" wrote in message
...
I must thank you for your effort but unfortunately something was not
right. There was not a single match when there ought to be. What is this
A$1:A$5?

Tom

"RagDyer" wrote in message
...
Say your name list is on Sheet1, A1 to A10, and you've pasted the csv to
Sheet2, from A1 down.

Try this *array* formula in B1 of Sheet1:

=INDEX(MID(Sheet2!A$1:A$5,FIND(",",Sheet2!A$1:A$5) +1,8),MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(",",Sheet2 !A$1:A$5)-1),0))

--
Array formulas must be entered with CSE, <Ctrl <Shift <Enter,
instead of
the regular <Enter, which will *automatically* enclose the formula in
curly
brackets, which *cannot* be done manually. Also, you must use CSE when
revising the formula.

*After* the CSE, copy down to A10.

If *no* match is found, you'll get a #N/A error returned.

If you really don't want to see the error message, and would prefer a
blank cell returned, the error trap makes this *array* formula "kind of
bigger":

=IF(ISNA(MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(",",She et2!A$1:A$5)-1),0)),"",INDEX(MID(Sheet2!A$1:A$5,FIND(",",Sheet2 !A$1:A$5)+1,8),MATCH(A1,LEFT(Sheet2!A$1:A$5,FIND(" ,",Sheet2!A$1:A$5)-1),0)))

Don't forget the CSE for this one also!


--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit
!
---------------------------------------------------------------------------

"Tom" wrote in message
u...
Hi,

My namelist.xls contains 10 stock codes for example - ABC, DEF, .....,
XYZ
in the first column. How can I match these names against the closing
pricelist, 20060912.csv which contains the date and the closing prices,
so
that if there is an exact match (not ABCD) it will record the
corresponding
date (or otherwise a blank) in the second column of namelist.xls?

To make it clear, the date field is the second element of the closing
pricelist as shown below:

AAC,20061204,1.85,1.86,1.85,1.86,33383
AAE,20061204,.415,.48,.405,.445,294925
ABC,20061204,43,43,43,43,0
ABCD,20061204,.22,.22,.21,.21,96000
ACG,20061204,10.21,10.52,10.2,10.46,2920359
<snip........

Much appreciate for any help.


TIA
Tom

PS. For those who enjoy challenges, after that, close 20060912.csv and
incrementally open up the next pricelist, namely 20060913.csv and do
the
match again, recording the date along the next, i.e. third column. Do
that
for N = 1 to N = 10.








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
How do I create a schedule from a list of dates ? Gavin Morris Charts and Charting in Excel 2 October 28th 10 04:08 PM
excel date scheduling not msProject 4pinoy Excel Worksheet Functions 0 November 11th 06 08:33 PM
MATCHING DATE TO A WEEKDAY Stuart Carnachan Excel Worksheet Functions 3 October 31st 06 05:19 PM
Matching the month and year portion of a date only RGB Excel Discussion (Misc queries) 1 June 9th 06 05:43 PM
NETWORKDAYS - Multiple Date Selection Annabelle Excel Discussion (Misc queries) 3 October 4th 05 07:04 PM


All times are GMT +1. The time now is 02:24 PM.

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

About Us

"It's about Microsoft Excel"