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
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
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:
Upvote 0
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"),"")
 
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,915
Members
448,532
Latest member
9Kimo3

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