Search tidal data

MLC12345

New Member
Joined
Sep 8, 2014
Messages
2
Hi,

I have a database of tidal data, i.e. the time with corresponding tide level, every 5 min a day. If you plot this data, you get a sinusoidal curve. I would like to be able to input a certain day + tide level and get the times back in which the tide is lower than this level. For example;
input: 09/09/14; 2.4m
output: from 0:05 to 9:25 and from 12:00 to 21:20

So this means that between 0:05 and 9:25 the tide is lower than 2.4m and between 12:00 and 21:20 the tide is again lower than 2.4m.
Since there are 2 high tides a day, I should always get 2 time intervals... I will also sometimes get 2.5 time intervals (e.g. if the tide is low again at midnight).

Help on this one would be greatly appreciated...

Thanks!
Marie
 

Some videos you may like

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Vidar

Well-known Member
Joined
Jul 19, 2012
Messages
1,254
Hi Marie

My suggestion assumes that your Dates are in column A, Time in column B and Tide Level in column C.
And if your input date is in cell E2, and Tide Level in cell F2, then try this array formula (must be confirmed with Ctrl+Shift+Enter)
If you need more than 5000 rows then adjust the formula accordingly.

="From "&TEXT(SMALL(IF($A$2:$A$5000=E2,IF($C$2:$C$5000 < F2,$B$2:$B$5000)),1),"h:mm")&" to "&TEXT(SMALL(IF($A$2:$A$5000=E2,IF($C$2:$C$5000 > F2,IF($B$2:$B$5000 > SMALL(IF($A$2:$A$241=E2,IF($C$2:$C$241 < F2,$B$2:$B$241)),1),$B$2:$B$5000))),1),"h:mm")&", and from "&TEXT(SMALL(IF($A$2:$A$5000=$E$2,IF($C$2:$C$5000 < $F$2,IF($B$2:$B$5000 > =SMALL(IF($A$2:$A$241=E2,IF($C$2:$C$241 > F2,IF($B$2:$B$241 > SMALL(IF($A$2:$A$241=E2,IF($C$2:$C$241 < F2,$B$2:$B$241)),1),$B$2:$B$241))),1),$B$2:$B$5000))),1),"h:mm")&" to "&TEXT(SMALL(IF($A$2:$A$5000=$E$2,IF($C$2:$C$5000 > $F$2,IF($B$2:$B$5000 > SMALL(IF($A$2:$A$241=$E$2,IF($C$2:$C$241 < $F$2,IF($B$2:$B$241 > SMALL(IF($A$2:$A$241=E2,IF($C$2:$C$241 > F2,IF($B$2:$B$241 > SMALL(IF($A$2:$A$241=E2,IF($C$2:$C$241 < F2,$B$2:$B$241)),1),$B$2:$B$241))),1),$B$2:$B$241))),1),$B$2:$B$5000))),1),"h:mm")&IFERROR(", and from "&TEXT(SMALL(IF($A$2:$A$5000=$E$2,IF($C$2:$C$5000 < $F$2,IF($B$2:$B$5000 > SMALL(IF($A$2:$A$241=$E$2,IF($C$2:$C$241 > $F$2,IF($B$2:$B$241 > SMALL(IF($A$2:$A$241=$E$2,IF($C$2:$C$241 < $F$2,IF($B$2:$B$241 > SMALL(IF($A$2:$A$241=E2,IF($C$2:$C$241 > F2,IF($B$2:$B$241 > SMALL(IF($A$2:$A$241=E2,IF($C$2:$C$241 < F2,$B$2:$B$241)),1),$B$2:$B$241))),1),$B$2:$B$241))),1),$B$2:$B$241))),1),$B$2:$B$5000))),1),"h:mm"),"")

Vidar
 
Last edited:

Vidar

Well-known Member
Joined
Jul 19, 2012
Messages
1,254
If you need more than 5000 rows then adjust the formula accordingly.
Vidar

I noticed that not all my ranges went to row 5000. So here is the edited formula. Remember to confirm with Ctrl+Shift+Enter.

="From "&TEXT(SMALL(IF($A$2:$A$5000=E2,IF($C$2:$C$5000 < F2,$B$2:$B$5000)),1),"h:mm")&" to "&TEXT(SMALL(IF($A$2:$A$5000=E2,IF($C$2:$C$5000 > F2,IF($B$2:$B$5000 > SMALL(IF($A$2:$A$5000=E2,IF($C$2:$C$5000 < F2,$B$2:$B$5000)),1),$B$2:$B$5000))),1),"h:mm")&", and from "&TEXT(SMALL(IF($A$2:$A$5000=$E$2,IF($C$2:$C$5000 < $F$2,IF($B$2:$B$5000 > =SMALL(IF($A$2:$A$5000=E2,IF($C$2:$C$5000 > F2,IF($B$2:$B$5000 > SMALL(IF($A$2:$A$5000=E2,IF($C$2:$C$5000 < F2,$B$2:$B$5000)),1),$B$2:$B$5000))),1),$B$2:$B$5000))),1),"h:mm")&" to "&TEXT(SMALL(IF($A$2:$A$5000=$E$2,IF($C$2:$C$5000 > $F$2,IF($B$2:$B$5000 > SMALL(IF($A$2:$A$5000=$E$2,IF($C$2:$C$5000 < $F$2,IF($B$2:$B$5000 > SMALL(IF($A$2:$A$5000=E2,IF($C$2:$C$5000 > F2,IF($B$2:$B$5000 > SMALL(IF($A$2:$A$5000=E2,IF($C$2:$C$5000 < F2,$B$2:$B$5000)),1),$B$2:$B$5000))),1),$B$2:$B$5000))),1),$B$2:$B$5000))),1),"h:mm")&IFERROR(", and from "&TEXT(SMALL(IF($A$2:$A$5000=$E$2,IF($C$2:$C$5000 < $F$2,IF($B$2:$B$5000 > SMALL(IF($A$2:$A$5000=$E$2,IF($C$2:$C$5000 > $F$2,IF($B$2:$B$5000 > SMALL(IF($A$2:$A$5000=$E$2,IF($C$2:$C$5000 < $F$2,IF($B$2:$B$5000 > SMALL(IF($A$2:$A$5000=E2,IF($C$2:$C$5000 > F2,IF($B$2:$B$5000 > SMALL(IF($A$2:$A$5000=E2,IF($C$2:$C$5000 < F2,$B$2:$B$5000)),1),$B$2:$B$5000))),1),$B$2:$B$5000))),1),$B$2:$B$5000))),1),$B$2:$B$5000))),1),"h:mm"),"")
 

Watch MrExcel Video

Forum statistics

Threads
1,123,514
Messages
5,602,093
Members
414,501
Latest member
mdhaumyu

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
Top