Averaging every Nth cell in a column

nilshammarsten

New Member
Joined
Nov 21, 2024
Messages
5
Office Version
  1. 2019
Platform
  1. Windows
I've got solar irradiance data for every hour of the year. It's formatted in the same column, and I need to find the average solar irradiance of each corresponding hour on each day of every month. That means the average irradiance at 1 pm, 2 pm, 3 pm, and so forth in January, February, etc. Would anyone be able to help me with the right formula to use? Below is my excel sheet and a picture of it.

YearMonthDayHourTemperatureDNIDNI Hourly Irradiance (Wh/m2)MonthHourAverage Irradiance
2020110-2.400Jan1
2020111-2.500Jan2
2020112-2.600Jan3
2020113-2.500Jan4
2020114-2.600Jan5
2020115-2.700Jan6
2020116-3.100Jan7
2020117-3.700Jan8
2020118-4.400Jan9
2020119-4.900Jan10
20201110-5.100Jan11
20201111-5.100Jan12
20201112-5.300Jan13
20201113-4.900Jan14
20201114-2.8336336Jan15
20201115-0.9793793Jan16
202011160.3710710Jan17
202011171.1675675Jan18
202011181.6891891Jan19
202011191.8871871Jan20
202011201.5805805Jan21
20201121-0.5668668Jan22
20201122-2.3190190Jan23
20201123-1.900Jan24
2020120-1.300Feb1
2020121-0.700Feb2
2020122-0.200Feb3
20201230.200Feb4
20201240.400Feb5
20201250.400Feb6
20201260.400Feb7
20201270.200Feb8
2020128000Feb9
2020129-0.100Feb10
202012100.100Feb11
20201211000Feb12
20201212-0.200Feb13
202012130.100Feb14
202012141.48383Feb15
202012153.2543543Feb16
202012164.4595595Feb17
202012175348348Feb18
202012185.3580580Feb19
202012195.1562562Feb20
202012204.57676Feb21
202012213.52121Feb22
202012222.600Feb23
202012232.500Feb24
20201302.500
20201313.200
20201323.500
20201333.500
20201343.400
20201353.400
20201363.500
20201373.300
20201383.200
2020139300
202013102.800
202013112.600
202013122.400
202013132.300
202013142.72020
202013153.2140140
2020131645757
202013174.7108108
202013185.16161
202013195.1114114
202013204.500
202013213.1162162
20201322200
202013231.600
20201401.300
20201411.100
20201420.900
20201430.800
20201440.500
20201450.300
20201460.100
2020147-0.200
2020148-0.600
2020149-0.500
20201410-0.600
20201411-0.800
20201412-0.800
20201413-0.400
202014140.400
202014150.900
202014161.100
202014171.100
202014181.14646
20201419111
202014200.800
202014210.100
20201422-0.700
20201423-100
2020150-1.400
2020151-1.800
2020152-2.100
2020153-2.300
2020154-2.600
2020155-2.900
2020156-300
2020157-3.100
2020158-3.100
2020159-3.100
20201510-300
20201511-2.900
20201512-2.600
20201513-1.900
20201514-0.86363
2020151501111
202015160.500
202015170.900
202015180.600
20201519-0.200
20201520-0.73131
20201521-0.800
20201522-0.600
202015230.500
20201601.300
20201611.700
20201621.500
20201631.100
2020164100
20201650.900
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Welcome to the Board!

I think you should be able to use an AVERAGEIFS formula, were you can average records meeting certain criteria.
So you can have both Month and Time as your criteria.

See here for details, and post back (with the formula you attempted) if you run into any difficulty.
 
Upvote 0
Welcome to the Board!

I think you should be able to use an AVERAGEIFS formula, were you can average records meeting certain criteria.
So you can have both Month and Time as your criteria.

See here for details, and post back (with the formula you attempted) if you run into any difficulty.
Hello, thank you!

I tried using this one but it didn't work
=AVERAGEIF(V2:V745,MOD(COLUMN(V2:V745),24)=1)
 
Upvote 0
What is column V?
We cannot tell, as your original image has not column headers.

I think you at least two different columns in your formula:
- the ones you are using for your criteria
- the ones you are using for your sum
 
Upvote 0
What is column V?
We cannot tell, as your original image has not column headers.

I think you at least two different columns in your formula:
- the ones you are using for your criteria
- the ones you are using for your sum
 
Upvote 0
1732222843559.png
 
Upvote 0
Firstly, you want columns B and X formatted the same way so you can match them up (either use "Jan" for both, or "1" for both).

Then you can do it like this (simplified example to show you the method):

1732224070294.png


So the formula in cell Z2 is this:
Excel Formula:
=AVERAGEIFS(V$2:V$17,B$2:B$17,X2,D$2:D$17,Y2)
which you can copy all the way down to cell Z5.
 
Upvote 0
Solution
Firstly, you want columns B and X formatted the same way so you can match them up (either use "Jan" for both, or "1" for both).

Then you can do it like this (simplified example to show you the method):

View attachment 119533

So the formula in cell Z2 is this:
Excel Formula:
=AVERAGEIFS(V$2:V$17,B$2:B$17,X2,D$2:D$17,Y2)
which you can copy all the way down to cell Z5.
Thank you, that worked perfectly!
 
Upvote 0
It probably does make sense to have both your month columns formatted the same but if you did want to keep it as you had in post 1 it isn't much of a problem.
One other thing that I noticed though is that in column D your daily hours go from 0 to 23 whereas in column Y your daily hours go from 1 to 24 and I'm not sure if that is how you actually want it and, if so, how you want that handled.

In any case, here a a couple of things to consider.
Column Z I believe produces the same results as Joe's formula (including the #DIV/0! error in row 25 - & there would be other rows below) but without the need to change the abbreviated month name in column X.
Column AA treats Hour 24 in col Y as Hour 0 in col D but I'm unsure if that is what you would want.

24 11 22.xlsm
ABCDMVWXYZAA
1YearMonthDayHourDNIDNI Hourly Irradiance (Wh/m2)MonthHourAverage IrradianceAverage Irradiance
2202011000Jan100
3202011100Jan200
4202011200Jan300
5202011300Jan400
6202011400Jan500
7202011500Jan600
8202011600Jan700
9202011700Jan800
10202011800Jan900
11202011900Jan1000
122020111000Jan1100
132020111100Jan1200
142020111200Jan1300
152020111300Jan14100.4100.4
1620201114336336Jan15297.4297.4
1720201115793793Jan16272.4272.4
1820201116710710Jan17226.2226.2
1920201117675675Jan18315.6315.6
2020201118891891Jan19309.6309.6
2120201119871871Jan20182.4182.4
2220201120805805Jan21170.2170.2
2320201121668668Jan223838
2420201122190190Jan2300
252020112300Jan24#DIV/0!0
Av per Hr
Cell Formulas
RangeFormula
Z2:Z25Z2=AVERAGEIFS(V$2:V$10000,B$2:B$10000,MONTH(1&X2),D$2:D$10000,Y2)
AA2:AA25AA2=AVERAGEIFS(V$2:V$10000,B$2:B$10000,MONTH(1&X2),D$2:D$10000,MOD(Y2,24))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,149
Members
453,021
Latest member
Justyna P

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