array based MAX func

cogen

Board Regular
Joined
Jul 7, 2006
Messages
52
I have the following data in the table below, the data continues to the end of the day to 7/2/2006 0:00 but I couldn't post all of it. What I'd like to do is a MAX function that will look for the max value in column B for 0:30 to 8am and 8pm to 0:00 on the next day and return just a single max value. I tried doing an array function in column D that would look at the hour values for each hour and based on that would do the max, but only got the first piece of the puzzle right, any help would be greatly appreciated.
Book1.xls
ABCD
17/1/20060:3045839.721047931.066
27/1/20061:0045686.3381
37/1/20061:3045369.1951
47/1/20062:0045368.5642
57/1/20062:3045347.4472
67/1/20063:0045196.1953
77/1/20063:3044844.8853
87/1/20064:0044922.3554
97/1/20064:3044800.1434
107/1/20065:0044957.9535
117/1/20065:3044784.9945
127/1/20066:0044825.0236
137/1/20066:3044775.1276
147/1/20067:0044766.7957
157/1/20067:3044870.1957
167/1/20068:0045383.1158
177/1/20068:3045341.9248
187/1/20069:0046030.7139
197/1/20069:3046599.7709
207/1/200610:0047938.78110
217/1/200610:3048576.48810
227/1/200611:0048586.83411
237/1/200611:3048899.38311
247/1/200612:0049425.95112
257/1/200612:3049121.49212
267/1/200613:0049131.76413
277/1/200613:3048998.00813
287/1/200614:0049282.03714
297/1/200614:3049231.77014
307/1/200615:0049393.32615
Sheet1

Thanks in advanced
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
I have named your times range as 'Times' and your values range as 'Values'. I have also assumed that the same effect can be had by assuming that you want to exclude all times between 08:30 and 19:30 rather than include all times in the two ranges either side of that. If not, the formula can be adapted to cope.

In my test, the start and end times are held in cells J2 and J3.

=MAX(--(NOT(Times>J2))+--(NOT(Times>J3))*Values) [see note below]

entered as an array formula.

Hope this helps.

NB: The Board software seems to be truncating my formula if I put the < sign in the formula. You need to replace the second > with the less than sign.
 
Upvote 0
NB: The Board software seems to be truncating my formula if I put the < sign in the formula. You need to replace the second > with the less than sign.

sometimes the < and > signs are interpreted as HTML tags

either use the code tags so that formula looks like this

Code:
=MAX((Times>=J2)*(Times<=J3)*values)

or put spaces before and after < or > signs
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,473
Members
452,915
Latest member
hannnahheileen

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