IF Statement Help (again)

afv123

New Member
Joined
Feb 11, 2016
Messages
18
I have a lot of trouble with IF statements. I'm trying to use a series of IF statements to summarize data vs. a pivot table and having to remember to refresh the Pivot when the data changes.

I would like to find the Minimum, Average, and Maximum from a series of dollar values based on an assigned category.

I'm summarizing data by each category and based on the category I want to find the min, the average, and the max. In the file, there is a Category column (4 categories 1-4) and a $ column. I want to summarize the min, avg, max of how much $'s are in each category.

I tired the following for average, and it's not working:
averageif(category column F:F, category on summary, $ column)
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hello - just to give you an example of combining IF & MAX together with AVERAGE

Name. Sales
John. 100
Joe. 102
Chris. 104
Amy. 106

Let's say we want to enter a condition with If and max by saying;

=IF(MAX(Sales Range)>100, AVERAGE(Sales Range)). This would equal 103. However, say if the condition is > 150, it would return FALSE. Basically, we are asking the question, is the MAXIMUM value in the range greater than 100, yes, is it greater than 106, no, therefore it will return a FALSE. If you wanted to return nothing, just enter, "") after the AVERAGE. Hope this may help.
 
Upvote 0
Attached is an example of what I'm trying to get to, in the fields that I've placed the "?" using the data listed below in the example.
 

Attachments

  • Example.png
    Example.png
    90.4 KB · Views: 4
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

With Excel 2019, they introduced new functions called MAXIFS, MINIFS, and AVERAGEIFS that do exactly what you want - get the MAX, MIN, and AVERAGE values based on certain conditions.
 
Upvote 0
Something like this:

If your version of Excel supports them, you can use the formulas in columns B:D, otherwise something like the formulas in F:H.
Book1
ABCDEFGH
1SUMMARY
2CategoryMinAverageMax
31$50.00$75.00$100.00$50.00$75.00$100.00
42$25.00$37.50$50.00$25.00$37.50$50.00
53$20.00$47.50$75.00$20.00$47.50$75.00
64$10.00$67.50$125.00$10.00$67.50$125.00
7
8
9DATA
10CategoryAmount
111$50.00
121$100.00
134$10.00
142$25.00
153$75.00
164$125.00
172$50.00
183$20.00
Sheet1
Cell Formulas
RangeFormula
B3:B6B3=MINIFS($B$11:$B$18,$A$11:$A$18,A3)
C3:C6C3=AVERAGEIF($A$11:$A$18,A3,$B$11:$B$18)
D3:D6D3=MAXIFS($B$11:$B$18,$A$11:$A$18,A3)
F3:F6F3=MIN(IF($A$11:$A$18=A3,$B$11:$B$18,""))
G3:G6G3=AVERAGE(IF($A$11:$A$18=A3,$B$11:$B$18,""))
H3:H6H3=MAX(IF($A$11:$A$18=A3,$B$11:$B$18,""))
 
Upvote 0
Solution
You're welcome, and happy to help. You should follow Joe's suggestion too and update your profile to show which version of Excel you are using so you get the most accurate help in the future.
 
Upvote 0

Forum statistics

Threads
1,218,274
Messages
6,141,485
Members
450,362
Latest member
Jyters

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