Combining Average if and sumproduct formulas

Kmitchell

Active Member
Joined
Feb 27, 2007
Messages
361
Office Version
  1. 365
Platform
  1. Windows
I have two formulas that work independently but I need to combine and having some difficulty.

Column E sits account names, if it says "FTEs or Headcount" I want it to do an average if formula, otherwise I want it to do a sumproduct formula.

Below is the average if array which works on its own.
AVERAGE(IF($F$4:$Q$4>=$S$2,IF(($F$4:$Q$4<=$S$3),$F566:$Q566))))

And below is the sumproduct which also works on it's own
SUMPRODUCT(--($F$4:$Q$4>=$S$2),--($F$4:$Q$4<=$S$3),$F2416:$Q2416)

I need to be able to combine the two to say if A2 = $E$1 (headcount), or A2 = $E$2 (FTEs) in the cell than do the Average(if formula, if not then do the sumproduct formula.

Any suggestions?
 
In your case averageifs and sumifs would be the better option if you are calculating 20000 rows. They are fairly easy to understand formulae presuming you are on 2007 or later.

I do use sumifs and averageifs but couldn't figure out how to get them to work if the data sat in several columns such as this last example. Yes on 2010.
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,215,360
Messages
6,124,491
Members
449,166
Latest member
hokjock

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