While awaiting a workbook with data in it I stole
GraH - Guido's file and:
View attachment 51462
1. Fill in the missing data in the first column (it looks that this might be a pivot table judging by
Nitika's picture, so might only need to
Repeat all labels in the
Report Layout dropdown in the
Layout section of
Pivottable tools section of the ribbon).
2. Create a pivot table as shown in the picture from the data in columns A to D (bold outline in the picture)
3. Filter the
Item Category in the pivot table using
Value Filters, and Top 10… to show only the top 1. This creates a table (highlighted in yellow) we can use to look up the category.
4. Add a new column (
CAT 2) in column E with the formula shown in the formula bar in the diagram.
QED.
Or forget all that (except for point 1 above) and use this in cell E2:
Code:
=IF(SUMIFS([Sum of Unit Price],[Order number],[@[Order number]],[Item category],"Equipment")>SUMIFS([Sum of Unit Price],[Order number],[@[Order number]],[Item category],"Aftermarket"),"Equipment","Aftermarket")