Reputation: 157
I am trying to create a formula in Excel that returns the highest decimal value for every integer in a list.
For example, my sheet may have the values [10, 10.1,10.4, 11.3] and I need it to return both 10.4 and 11.3 since 10.4 is larger than 10 and 10.1, and 11.3 is the largest decimal value for 11.
I need this so that a pivot table can filter out the values as IDs and only return the highest value, but I can't get anything working to the point that providing my existing 'code' wouldn't help whatsoever.
Thanks for the help
Upvotes: 0
Views: 696
Reputation: 1392
Pivot table and then group.
Max of values
Upvotes: 0
Reputation: 60224
If your list is sorted, you could use the Advanced Filter
to generate a list of the highest decimal value for each integer.
Given:
Criteria Formulas:
A2: =A6<>INT(A6)
B2: =OFFSET(A6,1,0)=INT(OFFSET(A6,1,0))
Criteria Dialog Note that you can choose to have the results copied elsewhere
Results
Upvotes: 1
Reputation: 738
Solve as follows:
value bracket decimal
10 =int(a2) =a2-b2
10.4 =int(a3) =a3-b3
10.1 =int(a4) =a4-b4
11 =int(a5) =a5-b5
11.3 =int(a6) =a6-b6
or values:
value bracket decimal
10 10 0
10.4 10 0.4
10.1 10 0.1
11 11 0
11.3 11 0.3
Now pivot by: bracket (columns/rows) and in the value section add the "original value", aggregate by "max".
Upvotes: 0