Help with Array that matches 2 dates with their data

khris50

New Member
Joined
Nov 15, 2018
Messages
1
Hi,

I have a table with a series of time and dates and their corresponding foreign exchange close price.

Column A has the time format of : 2017:11:14-08:00:00 to 2018:11:08-02:00:00 (Approx 6000 rows of data)Column B has the close prices in the format of: 7128.4 (Approx 6000 rows of data)

Now, I'm only interested in returning the close price from 09:00 to 20:00 each day and then subtracting it from the 08:00 close price to see which of the 09:00 to 20:00 values were higher/lower than the 08:00 close price.

With this information I want to count how many times the 09:00 to 20:00 close price was higher or lower than the 08:00 close price but I only want a count of 1 or 0 for higher or 1 or 0 for the first lower/higher close price per day if the close prices are different. For example, if the close price at 10:00 is higher than 08:00 then that would be 1 count of higher and no more counting of highs would be done for that day, but if price is lower then it counts one instance of that for the day.

The problem I'm having is matching the time date format of 09:00 to 20:00 with that of the 08:00 format. The forumla needs to match the day along with the time so they can be matched together. For example, 2017:11:14-08:00:00 to 2017:11:14-09:00:00 to 20:00:00

I can't use constants for the dates as rules out the rest of the array.

I've tried using isnumber, index/match and right/left.

=COUNT(IF(--ISNUMBER(SEARCH({"09:00:00","10:00:00","11:00:00","12:00:00","13:00:00","14:00:00","15:00:00","16:00:00","17:00:00","18:00:00","19:00:00","20:00:00"},A1:A600))*
IF(--ISNUMBER(SEARCH({"08:00:00"},B1:B600))<B1:B600,TRUE),B1:B600))

I think using index/match and right/left together might be my best bet.

=INDEX(B1:B600,MATCH(IF(RIGHT(A1,8)=(RIGHT(A1,8)),A1),A1:A600,0))

I need to find a way to remove the above constants though, so the formula can be flexible.

I hope this makes sense and any help on the above problem would be much appreciated.

Chris
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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