Forum Discussion
Return only one instance of value for a repeated Item Codes in Excel
- Aug 28, 2025
You want to avoid double-counting ad spend for an item that has multiple transactions in a month. Essentially, you want one value per item code per month, regardless of how many rows there are for that item, if I understand correctly.
You can use UNIQUE and FILTER (Excel 365 dynamic arrays)
If the value truly never changes within the month for an item, MAXIFS or MINIFS is the easiest and fastest.
If there’s a chance values differ and you want the first instance only, UNIQUE(FILTER(...)) is more precise.
hope this helps you
Have you considered creating a Pivot Table?
Item code in the Rows area and the sum of $$ in the Values area. In case your transactions span multiple months, put the date in the Columns area. Excel will then aggregate everything by month with grand totals for each item code and total spending by month for all item codes. Just an idea.