You are on page 1of 4

TO SELECT THE NEXT CLOSEST LARGER VALUE

IN EXCEL FROM DYNAMIC PRODUCT RANGE


To select a next closest larger number we can found many formulae in internet using “Countif”, “small”,
large, etc.,

One example using “Small“ as below

Formula : =SMALL($A$2:$A$10,COUNTIF($A$2:$A$10,"<"&B2)+1)
Here come the difficult part what we need to do to make the range in above “small “ formula as dynamic
based on selection of product Type?

?
The formula to select the next highest value from dynamic range
Using simple “indirect” and “ concatenate “ formulas

See for product C of 150 quantity , it will


check only in the range having product
type “C”

=SMALL((INDIRECT(CONCATENATE("$B$",@CELL("ROW",INDEX($A$2:$B$10,MATCH(C2,$A$2:$A$10,0),2)))):INDIRECT(
CONCATENATE("$B$",@CELL("row",INDEX($A$2:$B$10,MATCH(C2,$A$2:$A$10,0),2))+(COUNTIF($A$2:$A$10,C2))-
1))),COUNTIF((INDIRECT(CONCATENATE("$B$",@CELL("ROW",INDEX($A$2:$B$10,MATCH(C2,$A$2:$A$10,0),2)))):INDIR
ECT(CONCATENATE("$B$",@CELL("row",INDEX($A$2:$B$10,MATCH(C2,$A$2:$A$10,0),2))+(COUNTIF($A$2:$A$10,C2))-
1))),"<"&D2)+1)

You might also like