Averaging multiple lookup values

brucey

New Member
Joined
Oct 13, 2010
Messages
5
Dear all,

First post so please forgive lack of experience.

I've searched the forum and found many answers that seem to nearly fit my problem, but haven't been able to find a solution that works for me. Hopefully my description of my problem will mean someone can suggest a solution.

I'm looking for formula that will retrieve the average value of a set of cells that are adjacent to cells that meet a particular criteria. Let me elaborate....

My data is arranged as such:
Column A = Month
Column B = Day of the month
Column C = Recorded measurement (temperature)

Therefore, cells A2:A32 contain "Jan-06", cells B2:B32 contain the numbers 1-31 sequentially, cells C2:C32 contain a number representing the measurement. I have four years of data, so in total their are 1461 rows (4 x 365 + 1 header).

What I want is to calculate mean monthly temperature from these daily values.

Obviously, I could sort by the month and copy&paste into separate files but this would be time consuming (I have more data to process that stated here).

What I would like to have is a formula that will take the average of all the C cells that are adjacent to an A cell that contains the month I am interested.

I think some of the lookup functions embedded in a average function might work but I haven't the skill to make it successful.

Any advice or suggestions would be very welcome. :)
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Is this month specific to year or, say, all January dates from 2006,2007,2008 and 2009?
 
Upvote 0
Is this month specific to year or, say, all January dates from 2006,2007,2008 and 2009?

Yes, the dates are actually arranged 2006-01, 2006-02, etc. Not actually in date format but they work as unique identifiers.
 
Upvote 0
Ok, I’m assuming year-month is in column A and temperature in column C.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p> </o:p>
If you are using Excel 2007/2010, then:
=AVERAGEIF(A:A,"2006-01",C:C)
<o:p> </o:p>
If using 2003 or before then:
=SUMIF(A:A,"2006-01",C:C)/COUNTIF(A:A,"2006-01")
 
Upvote 0
Ok, I’m assuming year-month is in column A and temperature in column C.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p> </o:p>
If you are using Excel 2007/2010, then:
=AVERAGEIF(A:A,"2006-01",C:C)
<o:p> </o:p>
If using 2003 or before then:
=SUMIF(A:A,"2006-01",C:C)/COUNTIF(A:A,"2006-01")

Fantastic! Works perfectly. Talk about the simple solution. I had no idea about AVERAGEIF, its way simpler than what I had in mind. Thanks for your help. (y)
 
Upvote 0

Forum statistics

Threads
1,215,081
Messages
6,123,016
Members
449,093
Latest member
ikke

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