Find the Lowest and Highest Price for Each Part Number in Excel
Question details
Calculate the minimum purchase price, maximum purchase price, and price difference for each part number in a summary table.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A purchase data list contains multiple prices for the same part number, and the user wants one summary row per part.
- Observed behavior
- The desired summary shows each part number alongside its lowest price, highest price, and the difference between those prices.
For the examples below, place part numbers in A2:A100 and numeric purchase prices in B2:B100, then list the part numbers to summarize in column D. Make sure matching purchase rows have populated, numeric prices, and adjust the ranges to fit your data.
Use MINIFS and MAXIFS to summarize prices by part number
Use this method in Excel 2019 or later to calculate the lowest and highest price for each part number.
Enter each part number once in the summary table, starting in cell D2.
In E2, enter =IF(COUNTIF($A$2:$A$100,D2)=0,"",MINIFS($B$2:$B$100,$A$2:$A$100,D2)).
In F2, enter =IF(COUNTIF($A$2:$A$100,D2)=0,"",MAXIFS($B$2:$B$100,$A$2:$A$100,D2)).
In G2, enter =IF(E2="","",F2-E2), then select E2:G2 and drag the fill handle down for the remaining part numbers.

Use array formulas in older Excel versions
Use MIN and MAX with IF when your Excel version does not support MINIFS and MAXIFS.
Calculate Part Price Ranges in WPS Spreadsheet
Open your purchase data in WPS Spreadsheet and use conditional formulas to summarize the lowest and highest prices for each part number.
- 1. Open the workbook: In WPS Spreadsheet, choose Open and select your purchase data workbook.
- 2. Set up the summary: Place part numbers in A2:A100 and numeric prices in B2:B100, then enter the part numbers to summarize in D2 and below.
- 3. Calculate the price range: In E2, enter =IF(COUNTIF($A$2:$A$100,D2)=0,"",MINIFS($B$2:$B$100,$A$2:$A$100,D2)). In F2, enter =IF(COUNTIF($A$2:$A$100,D2)=0,"",MAXIFS($B$2:$B$100,$A$2:$A$100,D2)).
- 4. Find the difference: In G2, enter =IF(E2="","",F2-E2), then drag the fill handle on E2:G2 down the summary table.

Frequently Asked Questions
How do I calculate the price difference for each part?
Subtract the lowest price from the highest price. If those values are in E2 and F2, enter =F2-E2 in G2.
Why does MINIFS return zero for a part number that is not in my data?
MINIFS returns zero when no cells meet the criteria. Use COUNTIF to check for a match first, as in =IF(COUNTIF($A$2:$A$100,D2)=0,"",MINIFS($B$2:$B$100,$A$2:$A$100,D2)).
Can I use these formulas in an older version of Excel?
If MINIFS and MAXIFS are unavailable, use MIN(IF(...)) and MAX(IF(...)) array formulas and confirm each formula with Ctrl+Shift+Enter.
Does the lowest price represent the first purchase price?
Not necessarily. MINIFS finds the lowest matching price, regardless of purchase date. Finding the first purchase price requires using the date to identify the earliest transaction.




