Fetching data based on conditions

MoneyPlanters

New Member
Joined
Apr 9, 2011
Messages
41
Please have a look at the image.
Col A contains names of stock exchanges.
Col B contains dates.
Col C, D, E and F contain data that we shall be using. Col G and H are not required.

Every day one such file shall be imported from the internet and the newer file will always keep adding (appending) data to the existing one. For example if the screenshot is considered to be taken from a file that was downloaded today, a file downloaded 7 days later will contain more data than this one plus whatever this one has.

Now we need to achieve the following :

If col A is 'CAC40' then pick the OHLC (stands for Open, High, Low, Close; present in Col C through F) values that correspond to the latest date available and paste them in L824, M824, N824, O824.

Similarly, If col A is 'COMP' then pick the OHLC (stands for Open, High, Low, Close; present in Col C through F) values that correspond to the latest date available and paste them in L825, M825, N825, O825.

And so on.. till all the markets are covered. There are 15 of them.

How can we achieve this ? Kindly help.
Thank you.
 
You should be able to use the example below.

Excel Workbook
ABCDEFGHIJKL
1TickerDate/TimeOpenHighLowClose**OpenHighLowClose
2CAC4001-Jan2688414037881774*CAC4013632109001620216463
3CAC4002-Jan322647118003622*COMP19092124311622220508
4CAC4003-Jan73761582877******
5CAC4004-Jan177018481584481******
6CAC4005-Jan121053533912992******
7COMP01-Jan467617491983599******
8COMP02-Jan1898239249683320******
9COMP03-Jan294916182966878******
10COMP04-Jan27776253672269******
11COMP05-Jan2791275621663725******
Sheet1
#VALUE!
</td></tr></table></td></tr></table>


Cant really implement this.. i am pretty much ignorant. Please help.
 
Upvote 0

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
cant it be automated ?
Probably, but it sounds like there's a lot going on with this file and you might want to go another route with this.

You might want to fully automate the entire process but it would need VBA programming.

Pull in the data
Remove old data
Sort or group as necessary
Produce the summary

I'm not much of a programmer so I can't be of much help in that regard.
 
Upvote 0
Probably, but it sounds like there's a lot going on with this file and you might want to go another route with this.

You might want to fully automate the entire process but it would need VBA programming.

Pull in the data
Remove old data
Sort or group as necessary
Produce the summary

I'm not much of a programmer so I can't be of much help in that regard.

I am indeed grateful to you for whatever help you have given me. I didnt really mean 'automation'. My use of words has not been correct. What I meant was the use of another formula to eliminate the unnecessary data and then use your formula for the sorting and grouping.
 
Upvote 0
I am indeed grateful to you for whatever help you have given me. I didnt really mean 'automation'. My use of words has not been correct. What I meant was the use of another formula to eliminate the unnecessary data and then use your formula for the sorting and grouping.
Ok, well, the formula I suggested requires that the data be grouped together as is shown in your screencap.

If you delete "old" data then you should delete the entire row of data so that the data still remains grouped in a contiguous block.

I would put this data on its own sheet with nothing else. In your screencap this data started on row ~810 so there's a ton of other stuff on the sheet. Also, put the summary in another separate sheet.
 
Upvote 0
You should be able to use the example below.

Excel Workbook
ABCDEFGHIJKL
1TickerDate/TimeOpenHighLowClose**OpenHighLowClose
2CAC4001-Jan2688414037881774*CAC4013632109001620216463
3CAC4002-Jan322647118003622*COMP19092124311622220508
4CAC4003-Jan73761582877******
5CAC4004-Jan177018481584481******
6CAC4005-Jan121053533912992******
7COMP01-Jan467617491983599******
8COMP02-Jan1898239249683320******
9COMP03-Jan294916182966878******
10COMP04-Jan27776253672269******
11COMP05-Jan2791275621663725******
Sheet1
#VALUE!
</td></tr></table></td></tr></table>


njimack :Can you please assist me with this post ? Its almost the same. I only wish I had enough knowledge to modify your suggestions to suit this.
Thank you.
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top