AVERAGEIF with multiple cells

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
922
Office Version
  1. 365
HI,

I have the following tables:

Book1
DEF
5BranchStaffSales
6TexasStaff10
7TexasStaff20
8TexasStaff30
9TexasStaff40
10TexasStaff50
11TexasStaff60
12TexasStaff70
13TexasStaff80
14TexasStaff90
15TexasStaff100
16TexasTotal0
17New YorkStaff10
18New YorkStaff20
19New YorkStaff30
20New YorkStaff410
21New YorkStaff510
22New YorkStaff610
23New YorkStaff70
24New YorkStaff80
25New YorkStaff90
26New YorkStaff100
27New YorkTotal30
28DallasStaff10
29DallasStaff20
30DallasStaff30
31DallasStaff40
32DallasStaff510
33DallasStaff610
34DallasStaff710
35DallasStaff80
36DallasStaff90
37DallasStaff100
38DallasTotal30
39
40Average20
Sheet1
Cell Formulas
RangeFormula
F16,F38,F27F16=SUM(F6:F15)
F40F40=AVERAGE(F38,F27,F16)



I am trying to summarize the average of the total sales from three locations. However, I want the average calculation to only include that location total if the total for that location is more than zero. In the above example, the correct result should be 30 which is the average for the total for Dallas and New York since Texas total is zero. I tried using AVERAGEIF but did not get the result.

Appreciate any help.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
How about
Excel Formula:
=AVERAGEIFS(F6:F38,F6:F38,">0",E6:E38,"Total")
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,261
Messages
6,123,932
Members
449,134
Latest member
NickWBA

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