Hi,
So I have 2 columms, columm A that is in days and hours (2017-01-01 00:00, for example is my first data in the day in cell "A2") and columm B that represent Temperature on that given time.
I want to find the average temperature between 6am and 6pm and give the answer in a cell.
Dim i As Long
i = (Range("A2").Value)
Dim x As Single
Dim y As Single
x = (i + 0.25) 'x=6am
y = (i + 0.75) 'y=6pm
ActiveCell.Formula = "=AverageIf(B:B,A:A," > "&(i+0.25),A:A," < "&(i+0.75))"
It says Error 13. Can someone help me?
So I have 2 columms, columm A that is in days and hours (2017-01-01 00:00, for example is my first data in the day in cell "A2") and columm B that represent Temperature on that given time.
I want to find the average temperature between 6am and 6pm and give the answer in a cell.
Dim i As Long
i = (Range("A2").Value)
Dim x As Single
Dim y As Single
x = (i + 0.25) 'x=6am
y = (i + 0.75) 'y=6pm
ActiveCell.Formula = "=AverageIf(B:B,A:A," > "&(i+0.25),A:A," < "&(i+0.75))"
It says Error 13. Can someone help me?