by monthy avg calc if met criteria in diferent cell

rereis

New Member
Joined
Oct 9, 2006
Messages
35
.

Hello all I have the following xls:
------------A----------------B------------- C
1------- Date------- ----Ord#------- index
2------- 01/01/06-------W333-------7
3------- 01/03/06-------W332-------5
4------- 02/09/06-------W222------- 6
5-----------------------------------
6----------------------------
7----------- ---------------Jan-06-------Feb06
8------- Satisfied
9------- Dissatisfied

In row 8 I need to avg all index that are > than 6 for the month specified in row 7 and in row 9 all that are <=6.



Any suggestion?
Thanks
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
Assuming B7 is the 1st of the relevant month formatted as "mmm-yy"

in B8

=AVERAGE(IF($C$2:$C$4>6,IF($A$2:$A$4-DAY($A$2:$A$4)+1=B$7,$C$2:$C$4)))

confirmed with CTRL+SHIFT+ENTER and copied across. Similar for row 9
 

rereis

New Member
Joined
Oct 9, 2006
Messages
35
it trows a #Value error for the first IF. it appear that if doesn't like stuff like C2:C4>6
 

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
See this illustration
Book3
ABCD
1DateOrd#
201/01/2006W3337
301/03/2006W3325
402/09/2006W2226
5
6
7Jan-06Feb-06
8Satisfied7#DIV/0!
9Dissatisfied56
10
Sheet1


Note: B7 and B8 are dates formatted as mmm-yy - must be 1st of month. Formulas need to be confirmed with CTRL+SHIFT+ENTER so that curly braces appear around the formula in the formula bar.
 

rereis

New Member
Joined
Oct 9, 2006
Messages
35
Thanks Barry,

You did the trick I did not know about CTRL+SHIFT+ENTER

Thanks
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,029
Messages
5,856,933
Members
431,840
Latest member
simplysoph

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
Top