Sum and Total from Large Data Set

ZochSteveo

New Member
Joined
Dec 21, 2024
Messages
31
Office Version
  1. 2024
Platform
  1. MacOS
Hi there everyone,

I have been working hard to conduct an analysis for my dissertation. I have an expansive dataset which has recorded regular temperature levels in different homes in a house. Temperature is recorded every 5 minutes. I have attached below a little snippet so that it should make a bit more sense what is going on. I will try and describe it as best as I can. Essentially in column A, I have the date and the corresponding time (each at a 5-minute interval) followed then by the temperature recordings in the 3 different rooms in column B, C and D respectively. Column E and F have the sunrise and sunset time for that particular day.

In column G, I have an indicator as to whether or not the time in column A falls inbetween the sunrise and sunset time for that particular day and so can be considered "daylight". This returns TRUE if correct, and FALSE if not. I then have just the date in the following column.

Finally, in column I, I have an indicator as to whether or not the temperature in column B is equal to or above 26 degrees celsius, and if it falls into the daylight time as well. It outputs a value of 1 if this is the case and 0 if it is not.

Essentially, I want to be able to calculate the percentage of time that the temperature is equal to or above 26 degrees celcius for each individual day and its corresponding daylight timings (which as explained are all different). So I need a way of tallying up all the 1s in the column, and then dividing by the number of 5-minute intervals there are for that day. As you can probably tell, this data set is expansive and so contains a lot of readings, most of which are not relevant as the temperature is not equal to or above 26 degrees. What should be my approach here as I need to calculate a percentage of time the temperature is over 26 degrees for those days which do have recordings of over 26 degrees?

Any thoughts would be greatly appreciated. The snapshot I have included using XL2BB is only small as I cannot upload that much on here, but hopefully should be informative enough as it includes a section where the temperature was over 26 degrees.

Many thanks,

TRIAL ATTEMPT 2 copy.xlsx
ABCDEFGHI
252496/26/24 15:5525.967 °CN/AN/A4:5521:30TRUE6/26/240
252506/26/24 16:0025.939 °CN/AN/A4:5521:30TRUE6/26/240
252516/26/24 16:0525.905 °CN/AN/A4:5521:30TRUE6/26/240
252526/26/24 16:1025.945 °CN/AN/A4:5521:30TRUE6/26/240
252536/26/24 16:1526.011 °CN/AN/A4:5521:30TRUE6/26/241
252546/26/24 16:2026.068 °CN/AN/A4:5521:30TRUE6/26/241
Sheet6
Cell Formulas
RangeFormula
E25249:E25254E25249=INDEX($M$2:$M$184, INT((ROW()-1)/288) + 1)
F25249:F25254F25249=INDEX($N$2:$N$185, INT((ROW()-1)/288) + 1)
G25249:G25254G25249=AND(A25249>=DATEVALUE(TEXT(A25249, "dd/mm/yyyy")) + TIMEVALUE(TEXT(E25249, "hh:mm:ss")), A25249<=DATEVALUE(TEXT(A25249, "dd/mm/yyyy")) + TIMEVALUE(TEXT(F25249, "hh:mm:ss")))
H25249:H25254H25249=INT([@[Date-Time]])
I25249:I25254I25249=IF(AND([@[Daylight Indicator]]=TRUE, ISNUMBER([@[Lounge Temperature]]),[@[Lounge Temperature]]>=26),1,0)
 
Essentially, I want to be able to calculate the percentage of time that the temperature is equal to or above 26 degrees celcius for each individual day and its corresponding daylight timings

where do you want the output ?

you could get a unique set of dates
=unique( h2:h1000) whatever the range is
then
using that date
sumif(h2:H1000,the cell with the first unique date in , I2:I1000) / countif( h2:H1000,the cell with the first unique date in)

if you just want the daylight - G = TRUE

countifs( h2:H1000,the cell with the first unique date in , G2:G1000, TRUE)

sumif(h2:H1000,the cell with the first unique date in , I2:I1000) / countifs( h2:H1000,the cell with the first unique date in , G2:G1000, TRUE)
 
Upvote 0

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