Getting Maximum Values for a Date

Adecypher

New Member
Joined
Oct 15, 2016
Messages
15
Office Version
  1. 2016
Hi,
I have an excel sheet which has three columns Date, Time and Temperature. The data is hourly recorded with the start date of 4/11/2011 and time: 12:00:00 AM and the end date of 4/13/2021 and time: 12:00:00 AM i.e. 10 years of data. I need to condense this data by day and maximum value in a month. So for example for a year let say 2011 I should only have 9 records with Date and Maximum Temperature Value.

Please see the sample data (for 5 days) below.

Advice and suggestions will be appreciated.

Test Temp Data.xlsx
ABC
1Day TimeTemperature
24/11/201112:00:00 AM89.62777937
34/11/20111:00:00 AM89.83070039
44/11/20112:00:00 AM89.99633733
54/11/20113:00:00 AM89.79770601
64/11/20114:00:00 AM89.77417411
74/11/20115:00:00 AM89.74658754
84/12/20112:00:00 AM89.703755
94/12/20113:00:00 AM89.71455472
104/12/20114:00:00 AM89.72420336
114/12/20115:00:00 AM89.72695207
124/12/20116:00:00 AM89.74372769
134/12/20117:00:00 AM89.77702503
144/12/20118:00:00 AM89.80854813
154/12/20119:00:00 AM89.81030336
164/12/201110:00:00 AM89.81454374
174/12/201111:00:00 AM89.81543155
184/12/201112:00:00 PM89.81564971
194/12/20111:00:00 PM89.84937027
204/12/20112:00:00 PM89.86433073
214/12/20113:00:00 PM89.90774513
224/12/20114:00:00 PM89.91678239
234/12/20115:00:00 PM89.8968723
244/12/20116:00:00 PM89.88171432
254/12/20117:00:00 PM89.90538762
264/12/20118:00:00 PM89.90920861
274/12/20119:00:00 PM89.89170028
284/12/201110:00:00 PM89.90048188
294/12/201111:00:00 PM89.91579807
304/13/201112:00:00 AM89.94183986
314/13/20111:00:00 AM89.94780055
324/13/20112:00:00 AM89.89907908
334/13/20113:00:00 AM89.91624186
344/13/20114:00:00 AM89.90061185
354/13/20115:00:00 AM89.90005451
364/13/20116:00:00 AM89.92957078
374/13/20117:00:00 AM89.92594145
384/13/20118:00:00 AM89.94034973
394/13/20119:00:00 AM89.93831181
404/13/201110:00:00 AM89.97381138
414/13/201111:00:00 AM89.91008465
424/13/201112:00:00 PM89.9221225
434/13/20111:00:00 PM89.94248089
444/13/20112:00:00 PM89.92203148
454/13/20113:00:00 PM89.91160678
464/13/20114:00:00 PM89.89667063
474/13/20115:00:00 PM89.89071318
484/13/20116:00:00 PM89.88855241
494/13/20117:00:00 PM89.92544305
504/13/20118:00:00 PM89.90270771
514/13/20119:00:00 PM89.8626188
524/13/201110:00:00 PM89.85639712
534/13/201111:00:00 PM89.85573732
544/14/201112:00:00 AM89.82276248
554/14/20111:00:00 AM89.81841965
564/14/20112:00:00 AM89.82992964
574/14/20113:00:00 AM89.79677694
584/14/20114:00:00 AM89.80410821
594/14/20115:00:00 AM89.77753227
604/14/20116:00:00 AM89.79805526
614/14/20117:00:00 AM89.76632318
624/14/20118:00:00 AM89.79313255
634/14/20119:00:00 AM89.7954343
644/14/201110:00:00 AM89.75527056
654/14/201111:00:00 AM89.75959098
664/14/201112:00:00 PM89.74041897
674/14/20111:00:00 PM89.73745119
684/14/20112:00:00 PM89.72748286
694/14/20113:00:00 PM89.73357106
704/14/20114:00:00 PM89.73978163
714/14/20115:00:00 PM89.69373134
724/14/20116:00:00 PM89.69243007
734/14/20117:00:00 PM89.70108349
744/14/20118:00:00 PM89.69143145
754/14/20119:00:00 PM89.71144434
764/14/201110:00:00 PM89.68669843
774/14/201111:00:00 PM89.65879375
784/15/201112:00:00 AM89.62574137
794/15/20111:00:00 AM89.63699399
804/15/20112:00:00 AM89.60454973
814/15/20113:00:00 AM89.61356894
824/15/20114:00:00 AM89.61858809
834/15/20115:00:00 AM89.59192218
844/15/20116:00:00 AM89.65967075
854/15/20117:00:00 AM89.83517183
864/15/20118:00:00 AM89.80151035
874/15/20119:00:00 AM89.75513664
884/15/201110:00:00 AM89.68092351
894/15/201111:00:00 AM89.66758129
904/15/201112:00:00 PM89.51657856
914/15/20111:00:00 PM89.51700686
924/15/20112:00:00 PM89.23626623
934/15/20113:00:00 PM89.21921134
944/15/20114:00:00 PM89.32373699
954/15/20115:00:00 PM89.33945197
964/15/20116:00:00 PM89.3443829
974/15/20117:00:00 PM89.34052176
984/15/20118:00:00 PM89.35225468
994/15/20119:00:00 PM89.35955171
1004/15/201110:00:00 PM89.36179366
Sheet1
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

I'm also a bit confused about what you're after. If you have data over 10 years how do you end up with 9 results when you want it on a monthly basis?
 
Upvote 0
@Fluff
I apologize for the confusion. The excel version I am using is 2016 and to redefine my question: I need to condense the data by day with maximum temperature value.
 
Upvote 0
Ok how about
+Fluff 1.xlsm
ABCDEF
1Day TimeTemperatureDateTemperature
211/04/201100:00:0089.627779411/04/201189.9963373
311/04/201101:00:0089.830700412/04/201189.9167824
411/04/201102:00:0089.996337313/04/201189.9738114
511/04/201103:00:0089.79770614/04/201189.8299296
611/04/201104:00:0089.774174115/04/201189.8351718
711/04/201105:00:0089.7465875  
812/04/201102:00:0089.703755  
912/04/201103:00:0089.7145547  
1012/04/201104:00:0089.7242034  
1112/04/201105:00:0089.7269521  
1212/04/201106:00:0089.7437277  
1312/04/201107:00:0089.777025  
1412/04/201108:00:0089.8085481  
1512/04/201109:00:0089.8103034  
1612/04/201110:00:0089.8145437
1712/04/201111:00:0089.8154316
1812/04/201112:00:0089.8156497
1912/04/201113:00:0089.8493703
2012/04/201114:00:0089.8643307
2112/04/201115:00:0089.9077451
2212/04/201116:00:0089.9167824
2312/04/201117:00:0089.8968723
2412/04/201118:00:0089.8817143
2512/04/201119:00:0089.9053876
2612/04/201120:00:0089.9092086
2712/04/201121:00:0089.8917003
2812/04/201122:00:0089.9004819
2912/04/201123:00:0089.9157981
3013/04/201100:00:0089.9418399
3113/04/201101:00:0089.9478005
3213/04/201102:00:0089.8990791
3313/04/201103:00:0089.9162419
3413/04/201104:00:0089.9006118
3513/04/201105:00:0089.9000545
3613/04/201106:00:0089.9295708
3713/04/201107:00:0089.9259415
3813/04/201108:00:0089.9403497
3913/04/201109:00:0089.9383118
4013/04/201110:00:0089.9738114
4113/04/201111:00:0089.9100846
4213/04/201112:00:0089.9221225
4313/04/201113:00:0089.9424809
4413/04/201114:00:0089.9220315
4513/04/201115:00:0089.9116068
4613/04/201116:00:0089.8966706
4713/04/201117:00:0089.8907132
4813/04/201118:00:0089.8885524
4913/04/201119:00:0089.9254431
5013/04/201120:00:0089.9027077
5113/04/201121:00:0089.8626188
5213/04/201122:00:0089.8563971
5313/04/201123:00:0089.8557373
5414/04/201100:00:0089.8227625
5514/04/201101:00:0089.8184197
5614/04/201102:00:0089.8299296
5714/04/201103:00:0089.7967769
5814/04/201104:00:0089.8041082
5914/04/201105:00:0089.7775323
6014/04/201106:00:0089.7980553
6114/04/201107:00:0089.7663232
6214/04/201108:00:0089.7931325
6314/04/201109:00:0089.7954343
6414/04/201110:00:0089.7552706
6514/04/201111:00:0089.759591
6614/04/201112:00:0089.740419
6714/04/201113:00:0089.7374512
6814/04/201114:00:0089.7274829
6914/04/201115:00:0089.7335711
7014/04/201116:00:0089.7397816
7114/04/201117:00:0089.6937313
7214/04/201118:00:0089.6924301
7314/04/201119:00:0089.7010835
7414/04/201120:00:0089.6914315
7514/04/201121:00:0089.7114443
7614/04/201122:00:0089.6866984
7714/04/201123:00:0089.6587938
7815/04/201100:00:0089.6257414
7915/04/201101:00:0089.636994
8015/04/201102:00:0089.6045497
8115/04/201103:00:0089.6135689
8215/04/201104:00:0089.6185881
8315/04/201105:00:0089.5919222
8415/04/201106:00:0089.6596708
8515/04/201107:00:0089.8351718
8615/04/201108:00:0089.8015104
8715/04/201109:00:0089.7551366
8815/04/201110:00:0089.6809235
8915/04/201111:00:0089.6675813
9015/04/201112:00:0089.5165786
9115/04/201113:00:0089.5170069
9215/04/201114:00:0089.2362662
9315/04/201115:00:0089.2192113
9415/04/201116:00:0089.323737
9515/04/201117:00:0089.339452
9615/04/201118:00:0089.3443829
9715/04/201119:00:0089.3405218
9815/04/201120:00:0089.3522547
9915/04/201121:00:0089.3595517
10015/04/201122:00:0089.3617937
Data
Cell Formulas
RangeFormula
E2:E15E2=IFERROR(INDEX($A$2:$A$1000,AGGREGATE(15,6,(ROW($A$2:$A$1000)-ROW($A$2)+1)/ISNA(MATCH($A$2:$A$1000,$E$1:$E1,0))/($A$2:$A$1000<>""),1)),"")
F2:F15F2=IF(E2="","",MAX(IF($A$2:$A$1000=E2,$C$2:$C$1000)))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution
Thanks but my computer currently is hanged and it says "processing" since I have around 85000 rows in the original work book.
 
Upvote 0
With that amount of data I'm not really surprised it's taking a while to calculate.
 
Upvote 0
I divided the data into years and then use the formulas and completed the calculations.

Thanks
 
Upvote 0
Here is an alternative solution where I created two different queries in Power Query

Max by date
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Day ", type date}, {"Time", type time}, {"Temperature", type number}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Day "}, {{"Max Temp", each List.Max([Temperature]), type nullable number}})
in
    #"Grouped Rows"

Max by Month
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Day ", type date}, {"Time", type time}, {"Temperature", type number}}),
    #"Inserted Month" = Table.AddColumn(#"Changed Type", "Month", each Date.Month([#"Day "]), Int64.Type),
    #"Inserted Year" = Table.AddColumn(#"Inserted Month", "Year", each Date.Year([#"Day "]), Int64.Type),
    #"Grouped Rows" = Table.Group(#"Inserted Year", {"Month", "Year"}, {{"Max Temp", each List.Max([Temperature]), type nullable number}})
in
    #"Grouped Rows"

Book7
AB
1Day Max Temp
24/11/201189.99633733
34/12/201189.91678239
44/13/201189.97381138
54/14/201189.82992964
64/15/201189.83517183
DayMax


Book7
ABC
1MonthYearMax Temp
24201189.99633733
MonthMax
 
Upvote 0
Glad you sorted it & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,393
Members
449,081
Latest member
JAMES KECULAH

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