difference between max and min values IF...

hans

New member
Joined
Aug 26, 2014
Messages
2
Reaction score
0
Points
0
I am looking for a way to carry out a similar function to the AVERAGEIFS function but with differences.

Say that column A has a list of years (of which there are several entries for each year) and column B has a list of values. Is there a way of getting excel to give the difference between the maximum and minimum values in column B for a specific year?

Thanks in advance for any help.
 
Assuming the year is in D2, use this array formula

=MAX(IF($A$2:$A$50=$D2,$B$2:$B$50))-MIN(IF($A$2:$A$50=$D2,$B$2:$B$50))
 
Thanks very much! I think part of my problem was also that I was not entering the formula as an array (CTRL, SHIFT, RETURN) because it only seems to work if you do that.
 
Back
Top