Merging to data sets

A

Arun Kumar Saha

Hi all, hope all r doing well. Here i am struggling to write a VBA cod
which correspond to following:

Suppose I have four columns :

Date Price1 Date Price2
1/1/04 12 1/1/04 13
1/2/04 14 1/3/04 23
1/5/04 11 1/5/04 15
1/7/04 14 1/7/04 19
1/8/04 16 1/9/04 20

Where Price1 is prices for some stock1 and price2 is for stock2.

Now I want to merge these two price series according to common dates
That is I want to get following:

Date Price1 Price2
1/1/04 12 13
1/5/04 11 15
1/7/04 14 19


And separately,

Date Price1 Price2
1/1/04 12 13
1/2/04 14 NA
1/3/04 NA 23
1/5/04 11 15
1/7/04 14 19
1/8/04 16 NA
1/9/04 NA 20

Is there any Excel in-build function to do this type of calculation
Otherwise can anyone help me to write a VBA code for that?

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top