AVERAGEIF with multiple cells

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
951
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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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